COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: Esosa on 04 Feb 2020 09:04:50 AM

Title: Totals on Grouped Order No.
Post by: Esosa on 04 Feb 2020 09:04:50 AM
Example:

Lets say we have 10 order numbers, each of these orders have product description, amount, and price. I grouped all this information by the pertaining order number. How can I get a $ total of what each customer spent.


Thanks in Advance.


Title: Re: Totals on Grouped Order No.
Post by: MFGF on 04 Feb 2020 09:13:34 AM
Quote from: Esosa on 04 Feb 2020 09:04:50 AM
Example:

Lets say we have 10 order numbers, each of these orders have product description, amount, and price. I grouped all this information by the pertaining order number. How can I get a $ total of what each customer spent.


Thanks in Advance.

What defines how much a customer spent? Are all orders for the same customer, or do you have a mix of customers within the 10 orders?

If all orders are for the same customer, then something like

total([price] for report) should give you the overall price total

If you have different customers, then

total([price] for [customer]) should give you the customer total

Cheers!

MF.
Title: Re: Totals on Grouped Order No.
Post by: Esosa on 04 Feb 2020 09:30:11 AM
Do I add it as an expression? If I use the total option in the toolbar it gives me the total for all orders in the whole table.
Title: Re: Totals on Grouped Order No.
Post by: BigChris on 04 Feb 2020 09:41:42 AM
I know it sounds daft, but add grouping to the product description as well. You should then be able to use the total option from the toolbar to get a total per order number.
Title: Re: Totals on Grouped Order No.
Post by: Esosa on 04 Feb 2020 10:20:50 AM
Totally worked, thank you very much for your time.
Title: Re: Totals on Grouped Order No.
Post by: BigChris on 05 Feb 2020 03:23:42 AM
No idea why it works though...doesn't make any sense to me, but if it gets you the result you need  :D