locked
Filter condition on multiple measures RRS feed

  • Question

  • Hi,

    I need filter condition on multiple measures.

    means below query i passed one measure right.now i need to pass two

    ([Measures].[Internet Sales Amount],[Measures].[Tax Amount])  measures.

    Is it possible or not?

    Can you please help me.

    Mdx query

    SELECT { [Measures].[Internet Sales Amount],[Measures].[Tax Amount] } ON columns

          ,filter([Product].[Product].[Product],

                     ( [Date].[Calendar Year].[Calendar Year].& [2008]

                      ,[Measures].[Internet Sales Amount]

                      ) > 0

                AND (

                      [Date].[Calendar Year].& [2007]

                      ,[Measures].[Internet Sales Amount]

                      ) > 0)

                      ON rows FROM [Adventure Works]


    indu

    Thursday, November 28, 2013 12:50 PM

Answers

  • You can 2 more AND conditions to FILTER and get the results you are looking for

    SELECT
      {[Measures].[Internet Sales Amount],[Measures].[Tax Amount]} ON COLUMNS
     ,Filter
      (
        [Product].[Product].[Product]
       ,
          ([Date].[Calendar Year].[Calendar Year].&[2008],[Measures].[Internet Sales Amount])    > 0
     AND
          ([Date].[Calendar Year].[Calendar Year].&[2007],[Measures].[Internet Sales Amount])    > 0
     AND
          ([Date].[Calendar Year].[Calendar Year].&[2008],[Measures].[Tax Amount])    > 0
     AND
          ([Date].[Calendar Year].[Calendar Year].&[2007],[Measures].[Tax Amount])    > 0

      ) ON ROWS
    FROM [Adventure Works];

    • Marked as answer by Elvis Long Sunday, December 8, 2013 11:15 AM
    Saturday, November 30, 2013 1:07 PM

All replies

  • You can 2 more AND conditions to FILTER and get the results you are looking for

    SELECT
      {[Measures].[Internet Sales Amount],[Measures].[Tax Amount]} ON COLUMNS
     ,Filter
      (
        [Product].[Product].[Product]
       ,
          ([Date].[Calendar Year].[Calendar Year].&[2008],[Measures].[Internet Sales Amount])    > 0
     AND
          ([Date].[Calendar Year].[Calendar Year].&[2007],[Measures].[Internet Sales Amount])    > 0
     AND
          ([Date].[Calendar Year].[Calendar Year].&[2008],[Measures].[Tax Amount])    > 0
     AND
          ([Date].[Calendar Year].[Calendar Year].&[2007],[Measures].[Tax Amount])    > 0

      ) ON ROWS
    FROM [Adventure Works];

    • Marked as answer by Elvis Long Sunday, December 8, 2013 11:15 AM
    Saturday, November 30, 2013 1:07 PM
  • hi,

    Thank you so much for  your reply.

    if any other solutions?


    indu

    Sunday, December 1, 2013 5:34 PM