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