I am trying to do some conditional logic based on a hierarchy level. In my ssas cube I have the following hierarchy defined:
- Team
- Subteam
- Employee
- Subteam
I want to create a calculated member "efficiency" which does
DIVIDE([Measures].[A], [Measures].[B])
But only for the Employee level. For all other levels I need to exclude employees where
[Measures].[c] = 1
I'm not sure on how to achieve this and I hope someone can help me.
Thanks ahead!
EDIT My current code works like this. The problem is that the members are not filtered on subteam and team level
case when [Organigram].[Hierarchy].Currentmember.level IS [Organigram].[Hierarchy].[Employee]
then DIVIDE([Measures].[a] , [Measures].[b])
else
case when [Measures].[c] = 0
then DIVIDE([Measures].[a] , [Measures].[b])
else NULL
end
END,
IIF
and the function 'Level': docs.microsoft.com/en-us/sql/mdx/level-mdx ? Do you want to add this measure to your cube-script or is is just for an MDX script via a WITH clause ? – whytheq