Search code examples
sql-servermdx

Use double parameter in filter MDX


I try to execute mdx in SQL Server, and I have a filter like this:

*FILTER([Dim BSC].[BSCID].CHILDREN, [Dim BSC].[BSCID].CURRENTMEMBER  = 
[Dim BSC].[BSCID].&[1] ) 

It works correctly, but now I want to execute [BSCID].&[1] and [BSCID].&[2] at the same time so I change it to

*FILTER([Dim BSC].[BSCID].CHILDREN, [Dim BSC].[BSCID].CURRENTMEMBER  = 
[Dim BSC].[BSCID].&[1,2] ) 

But it returns empty result, how can I do double parameter to filter it? Regards

I also try

*FILTER([Dim BSC].[BSCID].CHILDREN, [Dim BSC].[BSCID].CURRENTMEMBER  = 
[Dim BSC].[BSCID].&[1].&[2] )    

but still getting empty


Solution

  • Why bother using FILTER, you could just use a set with the two members you are interested in:

    *{ 
           [Dim BSC].[BSCID].&[1],
         [Dim BSC].[BSCID].&[2] 
      }