COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: brassfid on 28 Jun 2012 06:13:30 AM

Title: Query Item as Header of Column
Post by: brassfid on 28 Jun 2012 06:13:30 AM
Hello all,

I have multiple items that are if then statements:

ex. If ([Version] = [Year])
Then ([Measure])
Else (0)

How do I get [Year] to show up as the header of the column?

Thanks!

David
Title: Re: Query Item as Header of Column
Post by: MFGF on 28 Jun 2012 07:28:08 AM
Hi,

Select the column header of the column, set the Source Type property to be "Report Expression", and set the Report Expression property to be your Year data item. You can only have one value in your column header using this method, though, so if you have multiple years in your data, your column heading will show the first one (I think). If you want anything different, let us know.

Regards,

MF.
Title: Re: Query Item as Header of Column
Post by: blom0344 on 28 Jun 2012 07:59:34 AM
I would consider unlocking the list header and using a singleton that fetches the year value (Assuming [ version] is a single value).  I wouldn't be too surprised if no data is displayed when multiple values for year exist   :o
Title: Re: Query Item as Header of Column
Post by: MFGF on 28 Jun 2012 09:10:28 AM
Out of morbid curiosity, I tried it, and got the first year displayed as the column header. It wasn't formatted well, though :)