views:

166

answers:

1

Hi I'd like to know how to make that "iif" work.

Basically, I need to filter the engineering "product codes" when originator is "John Smith". currentmember is not working or that iif is not working,

    SELECT 
  {
    (
      [Time].[Fiscal Hierarchy Time Calculations].[Month to Date],
      [Measures].[Sell - Bookings]
    )
  } ON COLUMNS,
  [Originators].[Originator One Letter Name].Children ON ROWS
FROM [Sales]
WHERE 
  (
    [Time].[Fiscal Month].&[2010-02-01T00:00:00],
    IIF
    (
        [Originators].[Originator One Letter Name].CurrentMember = "John Smith",
      Except
      (
        [Product Codes].[Product Primary Subcategory].Children,
        [Product Codes].[Product Primary Subcategory].&[ENGINEERING]
      ),
      [Product Codes].[Product Primary Subcategory].Children
    )
  );

Any ideas?

Thanks in advance.

Duy

A: 

The best way to compare members in MDX is to use IS:

SELECT 
  {
    (
      [Time].[Fiscal Hierarchy Time Calculations].[Month to Date],
      [Measures].[Sell - Bookings]
    )
  } ON COLUMNS,
  [Originators].[Originator One Letter Name].Children ON ROWS
FROM [Sales]
WHERE 
  (
    [Time].[Fiscal Month].&[2010-02-01T00:00:00],
    IIF
    (
        [Originators].[Originator One Letter Name].CurrentMember IS
            [Originators].[Originator One Letter Name].[JOHN SMITH],
      Except
      (
        [Product Codes].[Product Primary Subcategory].Children,
        [Product Codes].[Product Primary Subcategory].&[ENGINEERING]
      ),
      [Product Codes].[Product Primary Subcategory].Children
    )
  );

Of course, you would have to change [Originators].[Originator One Letter Name].[JOHN SMITH] for the proper unique name of the member

santiiiii