COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: oscarca on 11 Dec 2018 11:16:40 AM

Title: Passing member caption from OLAP to relational report
Post by: oscarca on 11 Dec 2018 11:16:40 AM
Hey,

I am trying to pass a parameter as a member caption when drilling from a olap report to a relational report. In the target report I have a render variable that renders 3 crosstabs (3 different queries) that will be displayed based on the member caption being passed. The Main report has a dimension called cumulative that consist of 3 members 'R12, Period & YTD'. The problem is that the target report that is running towards an relational data source doesn't have that dimension so I created 3 data items in each query:
Data item [R12] looks like this 'R12' basically just a string.
[Period] looks like this 'Period'
and [YTD] looks like this 'YTD'

The parameter name in the main report is called ?pCumu?
So I created a filter expression in the target report looking like this [R12] = ?pCumu? (R12 query & crosstab)
and [Period] = ?pCumu? (Period query & crosstab)
and [YTD] = ?pCumu? (YTD query & crosstab)

The render variable looks like this:
case
when
ParamDisplayValue('pCumu') = 'R12'
then
'R12'
when
ParamDisplayValue('pCumu') = 'Period'
then
'Period'
when
ParamDisplayValue('pCumu') = 'YTD'
then
'YTD'
else
'No'
end

When drilling from the main report it doesn't render the crosstab in the target report even though it sure looks like it passed the member caption from the cube report.
It seems like the render variable doesn't sense the member caption being passed.

All tips are greatful.
Best regards,
Oscar
Title: Re: Passing member caption from OLAP to relational report
Post by: CognosPaul on 11 Dec 2018 03:05:59 PM
So the render variable is a string with 'R12', 'Period', and 'YTD' values? Why not just call ParamDisplayValue('pCumu') directly?

Create a new layout expression on the page and pull in
'Disp: ' + ParamDisplayValue('pCumu') +'
Use: ' +ParamValue('pCumu')



With those on the page, what values do you see when the value is passed?

If you want to pass the parameter values exactly, another trick you could do is to put in three text prompts on the page. Set the default value on each of the prompts as needed, and reference those in the drill. You can then set the box type on the prompts to none so they won't appear on the page, but the values will still be passed.
Title: Re: Passing member caption from OLAP to relational report
Post by: oscarca on 12 Dec 2018 01:51:15 AM
Hey Paul,

'Disp: ' + ParamDisplayValue('pCumu') +'
Use: ' +ParamValue('pCumu')

The expression above gives me this when drilling to the target report:

Disp: Period
Use: Period

So it is strange that the render variable expression doesn't react to the values being passed when they look the same..
Title: Re: Passing member caption from OLAP to relational report
Post by: oscarca on 12 Dec 2018 02:13:26 AM
It actually worked placing a textbox prompts with default selections in the target report like you suggested, and then hiding it since you don't want see it.
It is still strange that that is needed when its clear that we render on the same value that is being passed from the main report i.e member caption: Period, R12 and YTD.

Thank you for your help Paul !