MDX for getting dimensions of a cube?

I want to run a select without explicitly naming the dimensions.

Assume that the given cube named “MyCube” has 2 dimensions, is it possible to run something like:

SELECT [ELEM X from first dimension] ON 0,  [ELEM Y from second dimension] ON 1
FROM [MyCube]

Alternatively is there a function that will return the list of all dimensions and that I can use to built my MDX?

You can get dimensions of a cube with following request
GET api/v1/Cubes(‘cubeName’)/Dimensions

@aeremenko True. But I want an MDX expression to get the same in order to avoid the extra roundtrip to the server just to get the dimensions.

As an option, you can make just one call to get all cubes and dimensions and then build your mdx dynamically based on the results of this request

GET api/v1/Cubes?$expand=Dimensions($select=Name)&$select=Name

@aeremenko There is a bounty in SO on this question:

1 Like