COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Thundercat on 27 Oct 2009 10:07:55 AM

Title: group list in to 2 groups and produce total for each group
Post by: Thundercat on 27 Oct 2009 10:07:55 AM
Hi
I have a list of companies and sales, I want to show the sales of one comapny against the total sales of all the others in a crosstab(as there is other data I want to add in).
e.g. I have;
Company |Sales
A           |15
B           |21
c           |35

I want to show;
company | Sales
A           |15
Others    |56

Any ideas
Title: Re: group list in to 2 groups and produce total for each group
Post by: whastings on 27 Oct 2009 11:39:45 AM
Drag a Query Calculation to the crosstab rows. In the query calculation, use an if statement:

if ( plant = 'A' )
then ( plant )
else ( 'Others' )

and just drag your sales measure into the measure cells.

If you want to parameterize your plant, you can do that too by replacing 'A' with ?Plant? (i.e. if ( plant = ?Plant? )...
Title: Re: group list in to 2 groups and produce total for each group
Post by: Thundercat on 27 Oct 2009 12:21:41 PM
Thanks whastings. that's a lot simpler than the solution I found which required me to create tables and then data items and join queies. ;D