COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: kado on 12 Oct 2011 11:12:38 AM

Title: Conditionally exchange columns
Post by: kado on 12 Oct 2011 11:12:38 AM
Cognoids,

I've got a requirement to conditionally change data items in a report based on the users selection. Whereas the report would default to:

Data Item 1, Measure 1

Then provide a value prompt to either select, Data Item 2 or Data Item 3. It seems silly to build 3 reports and I'd prefer to build 1 report with all Data Items (1,2,3) with Measure 1 and then only show the Data Item that is selected.

I thought I saw a technote on this back in the day but can't seem to find it. Ideally I would I'd like to build this in Business Insight but highly doubt thats possible so if I can find a robust solution in Report Studio that would suffice!

THANKS,
Kado
Title: Re: Conditionally exchange columns
Post by: Arsenal on 12 Oct 2011 11:52:30 AM
I think what you're looking for is dynamic column report. If you search for "dynamic column" on this board, you'll find a few various types of solutions - some use conditional styles to hide columns, some use promptmacro functions etc.
Title: Re: Conditionally exchange columns
Post by: kado on 12 Oct 2011 12:41:16 PM
Thanks for the tip!! I found a nice solution using a 'render variable'!
Title: Re: Conditionally exchange columns
Post by: kado on 20 Oct 2011 01:11:47 PM
Howdy,

As mentioned above, using a render variable I see a nice way to conditionally exchange one or many columns. In other words, using 1 list report and 1 query in conjunction with a variable (set as a property for a render variable) we can display multiple presentations of a similar set of data.

Is there a way to have the Cognos Query only evaluate the columns that will be rendered on the report. In other words, If I want to see column 1 and 2 on one report and 2 and 3 on another report, is there a way I can restrict the Cognos query from only evaluating (writing a query to the database) column 1 and 2 in the first option and 2 and 3 in the second option?

THANKs,
Kado

;D