user1254579
user1254579

Reputation: 4009

Mdx , All and All Members differences

In MDX what is the difference between

[Period].[Period Name].[Period Name].ALLMEMBERS 

and

[Period].[Period Name].ALL

are these statement same?

Upvotes: 4

Views: 11686

Answers (2)

George
George

Reputation: 702

No, they are not. ALLMEMBERS means all axis members, for instance: period1, period2, period3 .., including all periods in 1 member : All

So, [ALL] member means all periods. For example, you can calculate [Measures].[Total Sales] for each date in month or for all dates in month. This the case when you need just [ALL] member to do it

If you want to get just members, without ALL member, you should use: [DimA].[LevelA].Children

Upvotes: 4

whytheq
whytheq

Reputation: 35557

ALLMEMBERS is actually a function in the MDX language. This function returns a set of members. Slightly unusual a function being tagged on the end of a string but MDX is unusual.

MSDN reference to this function: https://msdn.microsoft.com/en-us/library/ms144768.aspx

[All] in the context you have given is a single member - the All member. Most hierarchies have one of these members. The most general form of this member I believe is [(All)]. Here is an example of it's use against AdvWrks cube:

SELECT 
  {[Measures].[Internet Sales Amount]} ON 0
 ,[Date].[Calendar].[(All)] ON 1
FROM [Adventure Works];

SELECT 
  {[Measures].[Internet Sales Amount]} ON 0
 ,[Date].[Calendar].[All] ON 1
FROM [Adventure Works];

I think a hierarchies all member can be renamed to something more descriptive such as All Dates in which case you would need to use either [All Dates] or [All]

I previously asked a question specifically about the All member: Is [All] a level aswell as a member

Upvotes: 7

Related Questions