whytheq
whytheq

Reputation: 35557

General way of pointing at All member of a hierarchy

In our cubes it is somewhat hit and miss what the "All" member of each hiearchy is called:

For different hierarchies:

So sometimes the cube developer has left the default and other times he has made the name more verbose.

In my mdx I would like to be able to always find this member without worrying what it is named.

Assuming the hierarchy actually has an All member, can I assume that this code will always work? :

[DimensionX].[HierarchyX].members.item(0).item(0)

Is there a more water-tight approach?

Upvotes: 0

Views: 30

Answers (1)

Marc Polizzi
Marc Polizzi

Reputation: 9375

I believe [All] is what you need :

select [Geography].[Geography].[All] on 0 from [Adventure Works]

will show :

All Geographies
$80,450,596.98

To my knowledge [All] is a shortcut to the all-member of a hierarchy,

Upvotes: 1

Related Questions