February 9, 2004 at 6:26 pm
I try create calculate member, some logic like t-sql code case statement, I using iif function to calculate it, but I need put when dimension = 2180
like
IIf
([DialerType].[Dialer Type Code].&[2180], some value, other value)
But after process it has #err on the calculate mesures? How to solve this?
Thanks
Rachel
February 11, 2004 at 12:09 pm
iif([DialerType].CurrentMember.Name = "2180", some value, other value)
Hope this helps,
Chadash
February 11, 2004 at 12:16 pm
Thank you for the response, I using
iif([DialerType].CurrentMember IS [DialerType].[Dialer Type Code].&[2180], some value, other value)
Works also, and your's also works, but the way I am new to MDX, do you know something on MDX like T-SQL does case statement, I can have at least three values to evaluate, the IIF only works for two sets of value.
Thank you for the response, I am very appriciate.
Rachel
February 11, 2004 at 12:50 pm
To the best of my knowledge there is no such statement for MDX. If the number of cases is not too much you can use nested iif or you can write a VB function to do the mapping you want.
iif(DialerType.CurrentMember.Name = "2180", "value1", iif(DialerType.CurrentMember.Name = "2181", "value2", "value3"))
If you choose to write the VB function you need to encapsulate it in a DLL and register it to the Analysis server. Then you can use it just like a UDF.
Chadash
February 11, 2004 at 1:08 pm
Very good idea, I will give a try.
Thanks
Rachel
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply