SCOPE MDX Cheat Sheet
Contributors: Vidas Matelis, Thomas Ivarsson
Scope statement examples
Can you use the Filter function in a SCOPE statement? SCOPE ( Filter([Date].[Calendar].[Month].MEMBERS, [Date].[Calendar].Properties("Month of Year") = "January") );Measures.[Amount] = 10;END SCOPE; | Can you create a SCOPE based on the Member property? SCOPE ( Filter([Date].[Calendar].[Month].MEMBERS, [Date].[Calendar].Properties("Month of Year") = "January") );Measures.[Amount] = 10;END SCOPE; |
How do you specify SCOPE for a Dimension to include all members before a certain member? SCOPE(NULL:[Date].[Calendar].[Calendar Quarter].&[2003]&[3]);This = 100;END SCOPE; | How do you specify SCOPE for a Dimension to include all members after a certain member? SCOPE([Date].[Calendar].[Calendar Quarter].&[2003]&[3]: NULL);This = 100;END SCOPE; |
How Can I define SCOPE in MDX for all measures in one measure group? SCOPE(MeasureGroupMeasures("Sales Orders"));This = ...;END SCOPE; | How Can I define SCOPE in MDX for all but one measures in one measure group? SCOPE(MeasureGroupMeasures("Internet Sales") - {[Measures].[Internet Tax Amount]});This = ...;END SCOPE; |
How Can I define SCOPE in MDX for all measures in multiple measure groups? SCOPE({MeasureGroupMeasures("Internet Sales"), MeasureGroupMeasures("Internet Orders"), MeasureGroupMeasures("Internet Customers") });This = ...;END SCOPE; |
Please contribute to this document. You can send e-mail with your query or just leave here comment. We will add query to the list.
Tags: mdx