Order of Members property of a cell

Is there a way to get dimension elements in Members property of cellset cell in the same order as dimensions are in a cube?

This is what I get:
image

image

Two last dimensions are swapped around.

1 Like

Does the response come from Canvas or from the REST API directly?

from Canvas. I didn’t try to run it directly, but I assume it will be the same.

I checked against the REST API. It doesn’t give you sorted coordinates by default…

This would give you the members in the alphabetical order of the dimensions…
https://localhost:12354/api/v1/ExecuteMDX?$expand=Cube,Cells($select=Value;$expand=Members($select=UniqueName;$orderby=Hierarchy/Dimension/Name))

I am not sure, but I think if you write a smarter $orderby query in the Request URL you could also get them in the proper order.

1 Like

Actually, sorted Members are meaningless in an Environment with multiple Hierarchies.

The order of the Member in the Array would not allow us to derive its dimension…
Like the cell could be at the intersection of 2 Hierarchies and have 5 Members instead of 4.

I suppose that’s why the TM1 REST API doesn’t bother ordering them properly.
I think the best we can do is to ask for the UniqueNames instead of the Names and do the rest in JS.

1 Like