Search code examples
cognos-10

Cognos 10 Display Query Result in Header as a ParamName or ParamValue


Cognos 10.2.2 Using a Data Item Expression to generate a column that populates each column row.

if ( [X].[X].[Yr]  = '15' ) then ( '2014-2015') else 
if ( [X].[X].[Yr]  = '16' ) then ( '2015-2016') else
if ( [X].[X].[Yr]  = '17' ) then ( '2016-2017') else NULL

Simple. Works great.

Want to use the resulting value as a single value in header.
So the report title displays "2015-2016" (without quotes) if ( [X].[X].[Yr] = '16' )

There is probably a very easy way to do this. Will not get the last couple of hours of my life back. Help!


Solution

  • I think what you want to use is a singleton. You can find the object in the Toolbox.

    Insert the singleton into the header, set the query property to be the data query containing the data item, and drag over the data item into the singleton.

    Note: Singletons can only show one value. If you give it a data item that is variant across rows, it will simply display the value from the first row only.