IBM Cognos Report Studio: Layout Calculation using parameter value when parameter is given through a Master Detail Relationship

StackOverflow https://stackoverflow.com/questions/20099053

  •  03-08-2022
  •  | 
  •  

Question

I have a value prompt with a static selection of choices (i.e. '2010', '2011', '2012', etc.). This value prompt is associated with a parameter in my Master Query called "pYearString". This master query again contains a Data Item ('YearString') which references this parameter, like this:

#prompt('pYearString', 'string', '2013')#

Through a master detail relationship, this Data Item is then again associated with a parameter in a detailed query, as can be shown here: (I have stripped the image for everything that I considered irrelevant).

MasterDetailRelationship

One of the data items in the detailed query ('ActualsThisYear') then again references this parameter, like this:

tuple(#"[My_Cube].[Time].[Time].[Year]->:[TM].[Time].[Time].[@MEMBER].[" + strip(prompt("pYear"), "'") + "]"#, [Actuals])

In which the first argument is a MUN to the selected year in my Time dimension. This is working fine, and I get the correct numbers. This means that the parameter in the detailed query is referenced correctly.

However, if I try to add a layout calculation to my column header in order to show the chosen year, nothing is displayed. The layout calculation could look something like this:

' ' + ParamDisplayValue('pYear')

This layout calculation was working perfectly fine when the parameter value was given directly from the value prompt, as opposed to through the master detail relationship I'm using now.

If someone is wondering why I'm using this cumbersome master detail relationship, it is because I need to manipulate the input in certain ways, which is not possible otherwise.

Does anyone know why this is happening, or even how to fix this?

Thanks in advance!

EDIT: The question is really boiling down to: Is it not possible to use layout calculations on parameters in detailed queries when their value is given through a Master-Detail Relationship?

Was it helpful?

Solution

  1. Try using ParamValue instead.

  2. Alternativly, add YearString to Parameters list for that query and refer that dataitem in report calculation.

  3. Also you can change property of the column header to DataItem Vaule and put your macro into that data item.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top