COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: jan54 on 01 Aug 2012 06:40:28 AM

Title: Group a list
Post by: jan54 on 01 Aug 2012 06:40:28 AM
Hi all,

Is it possible to group a list on different columns depending on a parameter.
So if I choose A it will group on column A, B on column B etc

Thanks
Jan
Title: Re: Group a list
Post by: Lynn on 01 Aug 2012 08:01:13 AM
Yes, it is possible. Create a data item in your query that resolves to either column A or B depending on the prompt selection. Then set the grouping to this derived column.

For example, the expression for the grouped column might be:


case ?groupParam?
when 'A' then [Namespace].[QuerySubject].[ColumnA]
else [Namespace].[QuerySubject].[ColumnB]
end


Good luck!