3

This feels like a really basic question, because it's a really basic function I'm looking for.

I know you can do this:

([Dimension].CurrentMember IS [Dimension].[AParticularMember])

and you get a logical 1 or 0 as the function value.

But how do you do this kind of thing, without concatenating IS functions in a whole lot of ugly ORs:

([Dimension].CurrentMember ISAMEMBEROF 
     {[Dimension].[AMember],[Dimension].[AnotherMember],[Dimension].[YetAnotherMember]}
)

?

This is really basic set operations, in one dimension only, but I just can't find the damn function that does it. I tried this:

NOT(ISEMPTY(INTERSECT([Dimension].CurrentMember,
{[Dimension].[AMember],[Dimension].[AnotherMember],[Dimension].[YetAnotherMember]})))

but it returned True for every dimension member. I'm guessing this is because what is going into the ISEMPTY function is not the dimension member, but the tuple

([Dimension].CurrentMember,[AnotherDimension].DefaultMember,  
[YetAnotherDimension].DefaultMember,... ,Measures.DefaultMember)

does the kind of function I'm looking for exist in MDX?

2 Answers 2

5

You were close:

INTERSECT([Dimension].CurrentMember,
{[Dimension].[AMember],[Dimension].[AnotherMember],[Dimension].[YetAnotherMember]}).Count > 0
0
0

In icCube you can use also IsIn Function

IsIn( {[Dimension].[AMember],[Dimension].[AnotherMember],[Dimension].[YetAnotherMember]} 
    , [Dimension].CurrentMember )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.