Showing posts with label operator. Show all posts
Showing posts with label operator. Show all posts

Friday, March 23, 2012

How to reflect the equivalent of the relational IN operator in MDX

I need to filter a set, based in another attribute hierarchy.

So I am looking for something like

filter(Time.Months.children , Time.Months.currentmember.label in ({Timen.MonthName.Children})

The list is generated dinamycally, so the OR approach wouldn't work (unless I write 12 expressions.

Any ideas ?

Thank you

Alejandro Leguizamo

SQL Server MVP

Could you give an example with data, to help clarify? If this is a case where dimensions [Time] and [Timen] have identical structure (eg: role-playing dimensions like Date and ShipDate in Adventure Works), and you want the set in [Time].[Months] hierarchy, equivalent to some set in [Timen].[Months], then LinkMember() may work, like:

Generate([TimenSet], {LinkMember([Timen].[Month].CurrentMember, [Time].[Month])})