COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: mrcool on 15 Jan 2016 09:12:47 PM

Title: Conditional column hiding
Post by: mrcool on 15 Jan 2016 09:12:47 PM
Hi All,

I have a report with columns conditionally hidden based on the prompt selection. The rows are not being aggregated when few columns are hidden.
I have tried both render variable and style variable with boxtype none property but no luck.
I could also see the hidden columns in the backend sql query. How to pass the columns that are only displayed on the report.
According to the below document render variable should work but it isn't working in my case. I am not sure if it is a bug in 10.2.2.
http://www.ibm.com/developerworks/library/ba-pp-reporting-dynamic_report_design-page682/index.html

Did anyone encounter similar issue?

Cheers,
Mc
Title: Re: Conditional column hiding
Post by: patrickthatcher on 17 Jan 2016 06:18:59 PM
What we did for our reports was to use checkboxes for all the fields we wanted to show/hide.  We then created variables for each of the fields such as this:

Name: Show Company
Expression Definition: ParamValue('HierID') contains '1'

For each of the corresponding fields in the checkbox, we modified the expression definition for the field to be like this:

if ('1' in ?HierID?) then
   ([Reporting View].[Business].[Company])
else
   (null)

I believe the (null) will remove the field from query as you wanted.

hth
Title: Re: Conditional column hiding
Post by: mrcool on 18 Jan 2016 03:48:56 PM
Thank you hth..

Sent from my A0001 using Tapatalk

Title: Re: Conditional column hiding
Post by: curious139 on 28 Jun 2022 08:12:10 AM
Hi,

I had the same issue and i followed the above steps and able to aggregate the rows based on selection as well

However, the columns I choose to aggregate appear as blank.

Any ideas on how to resolve this?

Thanks,