COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: Charlie_B on 24 Sep 2019 04:40:39 AM

Title: Display field in aggregate query only when prompt provided
Post by: Charlie_B on 24 Sep 2019 04:40:39 AM
Hi all,

I'm new to Cognos so apologies if some of my terminology is a little off.

I have a request to produce a report that counts number of records grouped by a few dimensions. The user also wants to be able to optionally filter by an additional dimention, but for that dimension not to be visible (and not contribute to the grouping) if nothing is selected in the prompt. Is this possible?

To give an example, let's say the user wants to count objects grouped by colour and shape, with the option to filter on both dimensions. But they also want to optionally filter on size as well. So if the size 'big' is selected in the prompts the report might look like this:






COLOUR SHAPE SIZECOUNT
RedCircleBig12
RedSquareBig5
BlueCircleBig1

But if a size is not selected, the report only groups by the other two elements:






COLOUR SHAPE COUNT
RedCircle30
RedSquare15
BlueCircle10

I know how to set up a prompt page with optional prompts, but can't work out if it's possible to exclude the field from the report if a prompt is not selected?
Title: Re: Display field in aggregate query only when prompt provided
Post by: Francis aka khayman on 24 Sep 2019 02:00:34 PM
on top of my head.... this will require creating the lists with all possible combinations. and based on the selected values in the prompt display the appropriate tables via conditional block.
Title: Re: Display field in aggregate query only when prompt provided
Post by: Charlie_B on 30 Sep 2019 10:08:17 AM
Thank you, I'd not come across conditional blocks before and that looks like it might be a solution.