Labels

ASP.NET (1) Data Model (1) Django (1) MDX (15) Python (3) Redshift (3) SSAS (15) SSRS (3) T-SQL (29)

Tuesday, 12 June 2012

MDX Named Set Using Filter and Except Functions

--Return members filtered on a custom property. We need to exclude the All level from the set to filter on since it does not have any custom properties.

Filter(Except([Warehouse].Members,{ [Warehouse].[All Warehouse]}), [Warehouse].CurrentMember.Properties("PROPERTYNAME") = "PROPERTYVALUE")


--How to create a named set referring to a separate column in the table used for the time dimension as a member property

{Filter([Time].[Month].Members, [Time].CurrentMember.Properties("IsCurrentMonth") <> "0").Item(0).Item(0)}

--To get product names with sales amount greater than 0
([Product]. [Product Name].[Product Name] ,NOT ISEMPTY([Measures].[Sales Amt]OR (NOT ISEMPTY([Measures].[Sales Amt] > 0))
FILTER
(
) )
)

No comments:

Post a Comment