4 Replies Latest reply: Oct 5, 2012 1:07 PM by Sumant RSS

    MDX  and Filter or Where

    Sumant
      Hello,
      I have below query which gives me customer names from Cube, where Customer is dimension
      SELECT
      { } ON COLUMNS,
      {[Customer].leaves}
      ON ROWS
      FROM [Sales Forecast]
      QUERY PROPERTIES flattenColumns="true"
      I want to add something more here and get those customers only where [Customer].[Channel] is "Distributor"
      How my query should be?

      Thanks,
      Sumant
        • 1. Re: MDX  and Filter or Where
          Sumant
          any update?
          • 2. Re: MDX  and Filter or Where
            809363
            There's a ton of documentation on mdx on the web. Here's one example from http://msdn.microsoft.com/en-us/library/ms144785.aspx

            SELECT
            { [Measures].[Sales Amount],
            [Measures].[Tax Amount] } ON COLUMNS,
            { [Date].[Fiscal].[Fiscal Year].&[2002],
            [Date].[Fiscal].[Fiscal Year].&[2003] } ON ROWS
            FROM [Adventure Works]
            WHERE ( [Sales Territory].[Southwest] )

            Edited by: matt on Dec 27, 2010 8:28 AM
            • 3. Re: MDX  and Filter or Where
              Sumant
              @matt
              Yes I have referred many documents from the web, however couldn't find the suitable solution for my problem.

              I might not have explained my problem very clearly.

              if you see the query,
              I am accessing customer dimension as my rows, and I want to have only those customers where [Customer].[Channel] has "Distributor" not the "InterCompany"

              we generally don't have the same dimension used as rows and where condition, right?

              thanks,
              Sumant
              • 4. Re: MDX  and Filter or Where
                Sumant
                Filter could fit in this.
                create a set using filter as below for example

                Filter
                (
                [PART].[Parts].members,
                [PART].CurrentMember.Properties("Site") = "Site1"
                )