0

I have to filter the measure value by a value in a the article group dimension.

Starting point:

Facts:

  • Inventory (only opening stock of a month)
  • Sales

Dimensions:

  • Articlegroup (content: articlegroup types: Service or not)
  • Article
  • Time

We have 2 types of sale:

  • Standard sale (affects invetory)
  • Service (doesn't affects inventory)

My MDX-Script calculates dynamically the daily stock over a month. The problem is that service-sales should not affects the inventory, so my script have to filter the measure value.

Such like:

CREATE MEMBER CURRENTCUBE.[Measures].[FilteredAmount]
AS (SELECT [Measures].[SalesAmount] FROM [Cube]
    WHERE [Article Group].[Service].&[0])
-- Service "0" = not service

CREATE MEMBER CURRENTCUBE.[Measures].[Amount]
AS [Measures].[OStockAmount] - [Measures].[FilteredAmount]  

I don't know how to filter the value

Blin4ik
  • 3
  • 3

1 Answers1

1

Try this:

CREATE MEMBER CURRENTCUBE.[Measures].[FilteredAmount]
AS ([Measures].[SalesAmount], [Article Group].[Service].&[0]);
-- Service "0" = not service

That creates a tuple that just retrieves a section of the cube... Measure SalesAmount and Service=0

GregGalloway
  • 11,355
  • 3
  • 16
  • 47
  • @Blin4ik glad to help! One way you could express your thanks is by [accepting the answer](http://meta.stackexchange.com/q/5234/179419) by clicking the checkmark. – GregGalloway Jan 15 '16 at 09:31