with member test as
case
when ([All Products].[All Products].[Group 2].&[1],[Measures].[minus-prod-trx])>0
then (ancestor([All Products].[All Products].[Group 2].&[1],2),[Measures].[minus-prod-trx])
when ([All Products].[All Products].[Group 2].&[2],[Measures].[minus-prod-trx])>0
then (ancestor([All Products].[All Products].[Group 2].&[2],2),[Measures].[minus-prod-trx])
end
Problem: How can I get both the values for if above both conditions satisfies? Now only one result returning though both condition satisfies. I tried with:
case
when [All Products].[Group 2].CURRENTMEMBER IS [All Products].[Group 2].&[1]
then...
But it's not working.
Assuming this hierarchy is
ON ROWS
:Then something like the following:
Here is an example of the above in use against MS's AdvWrks cube:
Results in the following:
In comments you put the following
This code looks ok to me.
[Dim Date].[Hierarchy].currentmember
is not equal to the member you have specified in the above -currentmember
looks at each row of the output and returns the current member but in the above you do not have this hierarchy on your rows ... so the currentmember is the All member so yourWHEN
condition is false.Sourav has fixed the above for you by creating the context so that currentmember returns a member other than the
All
member of the hierarchy:Please have a read of the definition of the currentmember function: https://msdn.microsoft.com/en-us/library/ms144948.aspx