COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: rvprasadreddy on 21 Nov 2014 04:05:31 AM

Title: Unable to pass dynamic key value to the parameter maps in report studio.
Post by: rvprasadreddy on 21 Nov 2014 04:05:31 AM
I have created a map is framework manger for relative time and looks like below,

Sample Map (ParamMap)
       Key                  Value
  2009_Nov                5     
  2008_Nov                4

It is working fine, When i pass static key value directly to map in report studio
Sample :  #$ParamMap{'2009_Nov'}$#

But when i try to build key dynamically from user input values then  it is not able to parse the expression properly

sample expression
#$ParamMap{#prompt('year','string') + '_' + {#prompt('month','string')}$#

Can some please help me to resolve this.
Title: Re: Unable to pass dynamic key value to the parameter maps in report studio.
Post by: CognosPaul on 21 Nov 2014 06:23:21 AM
The hashes should only appear at the beginning and end of the macro. Change the prompts to token, and wrap them with sq()
Title: Re: Unable to pass dynamic key value to the parameter maps in report studio.
Post by: rvprasadreddy on 24 Nov 2014 12:22:06 AM
Parameter map  key is building with help of data item component and key definition is
"cast(?dept?, varchar(10)) + '-' +'2008'+ '-'+cast(?phase?,varchar(10)) "

When parameter map filter is disabled, i am able to fetch key data to report.

When parameter map filter is enabled, i am getting below parsing error as below,

Defined parameter map filter as
"[Presentation View].[Time/Year/Phase/week].[PhaseHierarchy].[Week].[WEEK_KEY] between #$Phase_Start_Week_Map{sq([key])}# and #$Phase_End_Week_Map{sq([key]}#"

Error,
QE-PLN-0001

   
         Internal error. The query could not be planned by the Query Service:
MacroException - a parsing error was encountered in the macro:
Encountered "{" at line 1, column 109.
Was expecting one of:
"#" ...
"+" ...
         
Details
RSV-SRV-0042 Trace back:RSReportService.cpp(759): XQEException: CCL_CAUGHT: RSReportService::processImpl()RSReportServiceMethod.cpp(258): XQEException: CCL_RETHROW: RSReportServiceMethod::process(): asynchRunSpecification_RequestRSASyncExecutionThread.cpp(848): XQEException: RSASyncExecutionThread::checkExceptionRSASyncExecutionThread.cpp(305): XQEException: CCL_CAUGHT: RSASyncExecutionThread::runImpl(): asynchRunSpecification_RequestRSASyncExecutionThread.cpp(904): XQEException: CCL_RETHROW: RSASyncExecutionThread::processCommand(): asynchRunSpecification_RequestRSQueryMgrBasic.cpp(279): XQEException: CCL_RETHROW: RSQueryMgrBasic::executeRsapiCommandQFSSession.cpp(1153): XQEException: CCL_RETHROW: QFSSession::ProcessDoRequest()QFSSession.cpp(1151): XQEException: CCL_CAUGHT: QFSSession::ProcessDoRequest()QFSSession.cpp(1108): XQEException: CCL_RETHROW: QFSSession::ProcessDoRequest()QFSConnection.cpp(839): XQEException: CCL_RETHROW: QFSConnection::GetParametersQFSQuery.cpp(390): XQEException: CCL_RETHROW: QFSQuery::GetParametersXQEConnector.cpp(289): XQEException: CCL_THROW: XQEConnector::send

Title: Re: Unable to pass dynamic key value to the parameter maps in report studio.
Post by: CognosPaul on 14 Dec 2014 02:46:03 AM
Macros cannot communicate the contents of data items in the query. The entire calculation must be done with macro expressions inside the param map lookup.

Try something like:
[Presentation View].[Time/Year/Phase/week].[PhaseHierarchy].[Week].[WEEK_KEY] between #$Phase_Start_Week_Map{prompt('dept','token') + '-2008-'+prompt('phase','token')}# and #$Phase_End_Week_Map{prompt('dept','token') + '-2008-'+prompt('phase','token')}