![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have two dimensions which have multiple levels. The bottom level for both dimensions is "Item". These dimensions are used in an inventory cube. Now i have to create a calculated measure which rolls up seperately if it is the Item level or a higher level. do i need to check the level.name for each dimension separately or can i do it with a single statement. Anup |
#3
| |||
| |||
|
|
I don't believe there is any way to say something like "Do any of the levels of the current context has a level called item?". You need to test each dimension separately, but you can do it in one statement. However the logic after that will need to be generic enough to handle it. Otherwise you may need multiple nested iif statements. Something like the following pseudo code should work: IIF(dimension1.CurrentMember.Level.Name = "Item" OR dimension2.CurrentMember.Level.Name = "Item" , <true logic , <false logic>) Since you need to specify the dimensions individually anyway, possibly a better approach that would not rely on string matching and to do a direct comparison against the level objects. IIF(dimension1.CurrentMember.Level IS dimension1.Item OR dimension2.CurrentMember.Level.Name IS dimension2.Item , <true logic , <false logic>) You can also test to see if a member is at the bottom level of a hierarchy using the IsLeaf() function. HTH -- Regards Darren Gosbell [MCSD] Blog: http://www.geekswithblogs.net/darrengosbell In article <A75D9F12-F5A7-4CF1-85C5-1BFA63C64D5F (AT) microsoft (DOT) com>, Anup (AT) discussions (DOT) microsoft.com says... I have two dimensions which have multiple levels. The bottom level for both dimensions is "Item". These dimensions are used in an inventory cube. Now i have to create a calculated measure which rolls up seperately if it is the Item level or a higher level. do i need to check the level.name for each dimension separately or can i do it with a single statement. Anup |
![]() |
| Thread Tools | |
| Display Modes | |
| |