In mdx you can say:
CASE
WHEN [hist].[title].CURRENTMEMBER.MEMBER_CAPTION = "Mr"
THEN "Test1"
ELSE "Test2"
END
or
CASE
WHEN [hist].[title].CURRENTMEMBER
IS [hist].[title].[title].&[Mr]
THEN "Test1"
ELSE "Test2"
END
'IIF' is better to use as default:
IIF(
[hist].[title].CURRENTMEMBER.MEMBER_CAPTION = "Mr"
,"Test1"
,"Test2"
)
or
IIF(
[hist].[title].CURRENTMEMBER
IS [hist].[title].[title].&[Mr]
,"Test1"
,"Test2"
)
note
In terms of performance:
- IS
operator is preferable to using .MEMBER_CAPTION = "Mr"
- IIF
generally performs better than CASE
- If you can get away with one of the branches of IIF
being NULL
then chances are your calculation will run in the faster block mode.
So this would be best:
IIF(
[hist].[title].CURRENTMEMBER
IS [hist].[title].[title].&[Mr]
,"Test1"
,NULL
)