- Go into the query designer’s MDX query mode.
- Click the Query Parameters button on the menu bar.
- Enter parameter, dimension, hierarchy, and default values. Click OK.
- Add the parameter to the query. Click OK.
- I don’t want to give the user the choice of every member in the hierarchy so I have to prevent the parameter from auto updating. To do this switch to the report's code view.
- Find the entry for the parameter’s dataset and add SuppressAutoUpdate
</DataSet> <DataSet Name="EnrolledFromYear"> <Fields> <Field Name="ParameterValue"> <DataField><?xml version="1.0" encoding="utf-8"?><Field xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Measure" UniqueName="[Measures].[ParameterValue]" /></DataField> </Field> <Field Name="ParameterCaptionIndented"> <Value>=Space(3*Fields!ParameterLevel.Value) + Fields!ParameterCaption.Value</Value> </Field> <Field Name="ParameterCaption"> <DataField><?xml version="1.0" encoding="utf-8"?><Field xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Measure" UniqueName="[Measures].[ParameterCaption]" /></DataField> </Field> <Field Name="ParameterLevel"> <DataField><?xml version="1.0" encoding="utf-8"?><Field xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Measure" UniqueName="[Measures].[ParameterLevel]" /></DataField> </Field> </Fields> <Query> <DataSourceName>EdDWDataMart</DataSourceName> <CommandText>WITH MEMBER [Measures].[ParameterCaption] AS [Enrolled From Date].[Academic Calendar].CURRENTMEMBER.MEMBER_CAPTION MEMBER [Measures].[ParameterValue] AS [Enrolled From Date].[Academic Calendar].CURRENTMEMBER.UNIQUENAME MEMBER [Measures].[ParameterLevel] AS [Enrolled From Date].[Academic Calendar].CURRENTMEMBER.LEVEL.ORDINAL SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS , [Enrolled From Date].[Academic Calendar].ALLMEMBERS ON ROWS FROM [EdDW]</CommandText> <rd:DesignerState><QueryDefinition xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/AnalysisServices/QueryDefinition"><CommandType>MDX</CommandType><Type>Query</Type><QuerySpecification xsi:type="MDXQuerySpecification"><Select><Items /></Select><From>EdDW</From></QuerySpecification><Query><Statement>WITH MEMBER [Measures].[ParameterCaption] AS [Enrolled From Date].[Academic Calendar].CURRENTMEMBER.MEMBER_CAPTION MEMBER [Measures].[ParameterValue] AS [Enrolled From Date].[Academic Calendar].CURRENTMEMBER.UNIQUENAME MEMBER [Measures].[ParameterLevel] AS [Enrolled From Date].[Academic Calendar].CURRENTMEMBER.LEVEL.ORDINAL SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS , [Enrolled From Date].[Academic Calendar].ALLMEMBERS ON ROWS FROM [EdDW]</Statement></Query></QueryDefinition></rd:DesignerState> <rd:AutoGenerated>true</rd:AutoGenerated> <rd:Hidden>true</rd:Hidden> <rd:SuppressAutoUpdate>true</rd:SuppressAutoUpdate> </Query> </DataSet>
7. Go back to the report's design view. Right click on the datasource in the Report Data view and choose show hidden datasets. The EnrolledFromYear dataset will appear and can be edited
No comments:
Post a Comment