I am trying to create a set using MDX that contains a CASE statement. I am recieving an error i cannot seem to get around. The error is: The function expects a tuple set expression for the argument. A string or numeric expression was used.
There are only two members that could be returned, and they are ‘Daily’ and ‘MonthEnd’. I appreciate any help you can provide. At first i thought the error meant i needed to use the {} to create a set, but that is not making since to me, and i do not know where they would need to be added.
CREATE SET [BDW Report Prototype].[MyDimension] AS
CASE [Grain].[Grain Dim ID]
WHEN [Grain].[Grain Dim ID].&[1] THEN '1'
WHEN [Grain].[Grain Dim ID].&[2] THEN '2'
ELSE '3'
END;
It means the set you’re creating must a valid set (that is an ordered list of tuples) MDX expression. But you’re assigning to this set a string. You’re basically writing:
Obviously your [MyDimension] set is not a set but a string.
What do you want to create?