COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: MatusM on 04 Nov 2024 03:45:41 AM

Title: Summarize first, then Categorize
Post by: MatusM on 04 Nov 2024 03:45:41 AM
Hi,

my data looks like:

AccountItemBalance
AlphaItem A1500
AlphaItem A2800
AlphaItem A31200
BetaItem B1900
BetaItem B21500
GamaItem G1100
GamaItem G2200
GamaItem G3200
GamaItem G4200

In Cognos (12.0.3) report crosstab, I need to categorize Accounts into:
- Top Accounts with total Balance > 1000 per Account
vs
- Long Tail with lower Balance.

I'm doing this by calculated field:

Category
if ([Balance] >= 1000)
then ('Top Account')
else ('Long Tail')


But I'm not able to instruct Cognos to summarize Items first, just then categorize the Accounts.
So the result is:

AccountItemBalanceCategory
AlphaItem A1500Long Tail
AlphaItem A2800Long Tail
AlphaItem A31200Top Account
BetaItem B1900Long Tail
BetaItem B21500Top Account
GamaItem G1100Long Tail
GamaItem G2200Long Tail
GamaItem G3200Long Tail
GamaItem G4200Long Tail


But outcome I need is this:

AccountItemBalanceCategory
AlphaItem A1500Top Account
AlphaItem A2800Top Account
AlphaItem A31200Top Account
BetaItem B1900Top Account
BetaItem B21500Top Account
GamaItem G1100Long Tail
GamaItem G2200Long Tail
GamaItem G3200Long Tail
GamaItem G4200Long Tail

How do I achieve it, please?
Thank you!
Title: Re: Summarize first, then Categorize
Post by: MFGF on 04 Nov 2024 06:59:59 AM
Quote from: MatusM on 04 Nov 2024 03:45:41 AMHi,

my data looks like:

AccountItemBalance
AlphaItem A1500
AlphaItem A2800
AlphaItem A31200
BetaItem B1900
BetaItem B21500
GamaItem G1100
GamaItem G2200
GamaItem G3200
GamaItem G4200

In Cognos (12.0.3) report crosstab, I need to categorize Accounts into:
- Top Accounts with total Balance > 1000 per Account
vs
- Long Tail with lower Balance.

I'm doing this by calculated field:

Category
if ([Balance] >= 1000)
then ('Top Account')
else ('Long Tail')


But I'm not able to instruct Cognos to summarize Items first, just then categorize the Accounts.
So the result is:

AccountItemBalanceCategory
AlphaItem A1500Long Tail
AlphaItem A2800Long Tail
AlphaItem A31200Top Account
BetaItem B1900Long Tail
BetaItem B21500Top Account
GamaItem G1100Long Tail
GamaItem G2200Long Tail
GamaItem G3200Long Tail
GamaItem G4200Long Tail


But outcome I need is this:

AccountItemBalanceCategory
AlphaItem A1500Top Account
AlphaItem A2800Top Account
AlphaItem A31200Top Account
BetaItem B1900Top Account
BetaItem B21500Top Account
GamaItem G1100Long Tail
GamaItem G2200Long Tail
GamaItem G3200Long Tail
GamaItem G4200Long Tail

How do I achieve it, please?
Thank you!

Hi,

You can specify in the expression that you want to use the summary balance for each account, rather than the individual balance for each item. So your expression would be:

if (total([Balance] for [Account]) >= 1000)
then ('Top Account')
else ('Long Tail')

Cheers!

MF.
Title: Re: Summarize first, then Categorize
Post by: MatusM on 04 Nov 2024 09:35:40 AM
Thank you, works well!