Sunday, March 11, 2012

cascading parameter help - solution

I a report that will have two parameters (Year and Account name), I'm having trouble setting up the second parameter to be filtered based on the value of the first parameter.

here is the second parameter with a value hard coded.(see bold text) this works fine when I run the report.

WITH MEMBER [Measures].[ParameterCaption] AS '[CUSTOMER JOB].[ACCOUNT NAME].CURRENTMEMBER.MEMBER_CAPTION' MEMBER [Measures].[ParameterValue] AS '[CUSTOMER JOB].[ACCOUNT NAME].CURRENTMEMBER.UNIQUENAME' MEMBER [Measures].[ParameterLevel] AS '[CUSTOMER JOB].[ACCOUNT NAME].CURRENTMEMBER.LEVEL.ORDINAL' SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS ,FILTER([CUSTOMER JOB].[ACCOUNT NAME].ALLMEMBERS,([Job Complete Date].[Year].&[2006],[Measures].[Billed Sales Amount])) ON ROWS FROM [DW PREP ARCHIVE]

When I try the following code where I have added in the equal sign and double quotes I get an error message (see below)

= "WITH MEMBER [Measures].[ParameterCaption] AS '[CUSTOMER JOB].[ACCOUNT NAME].CURRENTMEMBER.MEMBER_CAPTION' MEMBER [Measures].[ParameterValue] AS '[CUSTOMER JOB].[ACCOUNT NAME].CURRENTMEMBER.UNIQUENAME' MEMBER [Measures].[ParameterLevel] AS '[CUSTOMER JOB].[ACCOUNT NAME].CURRENTMEMBER.LEVEL.ORDINAL' SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS ,FILTER([CUSTOMER JOB].[ACCOUNT NAME].ALLMEMBERS,(" & Parameter!JobCompleteDateYear.value & ",[Measures].[Billed Sales Amount])) ON ROWS FROM [DW PREP ARCHIVE]"

error message

TITLE: Microsoft Visual Studio

The query cannot be retrieved from the query builder.
Check the query for syntax errors.
Reporting Services will continue to use the most recent valid query.

ADDITIONAL INFORMATION:

Query preparation failed. (Microsoft.AnalysisServices.Controls)

Query (1, 1) Parser: The syntax for '=' is incorrect. (msmgdsrv)


BUTTONS:

OK

Any suggestions ?

thanks

I found my solution. I needed to use the Strtomember function and inserted the parameter name as @.parametername

here is the final code

before

WITH MEMBER [Measures].[ParameterCaption] AS '[CUSTOMER JOB].[ACCOUNT NAME].CURRENTMEMBER.MEMBER_CAPTION' MEMBER [Measures].[ParameterValue] AS '[CUSTOMER JOB].[ACCOUNT NAME].CURRENTMEMBER.UNIQUENAME' MEMBER [Measures].[ParameterLevel] AS '[CUSTOMER JOB].[ACCOUNT NAME].CURRENTMEMBER.LEVEL.ORDINAL' SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS ,FILTER([CUSTOMER JOB].[ACCOUNT NAME].ALLMEMBERS,([Job Complete Date].[Year].&[2006],[Measures].[Billed Sales Amount])) ON ROWS FROM [DW PREP ARCHIVE]

after

WITH MEMBER [Measures].[ParameterCaption] AS '[CUSTOMER JOB].[ACCOUNT NAME].CURRENTMEMBER.MEMBER_CAPTION' MEMBER [Measures].[ParameterValue] AS '[CUSTOMER JOB].[ACCOUNT NAME].CURRENTMEMBER.UNIQUENAME' MEMBER [Measures].[ParameterLevel] AS '[CUSTOMER JOB].[ACCOUNT NAME].CURRENTMEMBER.LEVEL.ORDINAL' SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS ,FILTER([CUSTOMER JOB].[ACCOUNT NAME].ALLMEMBERS,(Strtomember(@.JobCompleteDateYear),[Measures].[Billed Sales Amount])) ON ROWS FROM [DW PREP ARCHIVE]

No comments:

Post a Comment