Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi I'm new to Qlik sense and I'm encountering a problem. I'm trying to achieve the following task and Tried below expression and ended up having only one category in the table
Category to be created based on Sales.
| Region | Category | Sales | Profit |
| APAC | Top 20 | ||
| Next 20 | |||
| Rest | |||
| Global | Top 20 | ||
| Next 20 | |||
| Rest | |||
| Americas | Top 20 | ||
| Next 20 | |||
| Rest |
Tried Below Expressions:
1.
If(Aggr(Rank(TOTAL Sum({<Region={'APAC','Americas','Global'}>} Sales), 1, 1), Region) <= 20, 'Top 20', If(Aggr(Rank(TOTAL Sum({<Region={'APAC','Americas','Global'}>} Sales), 1, 1), Region) > 20 and
Aggr(Rank(TOTAL Sum({<Region={'APAC','Americas','Global'}>} Sales), 1, 1), Region) <= 40, 'Next 20', 'Rest'))
2.
If(Aggr(Rank(TOTAL Sum({<Region={'APAC','Americas','Global'}>} Sales)), Region) <= 20, 'Top 20', If(Aggr(Rank(TOTAL Sum({<Region={'APAC','Americas','Global'}>} Sales)), Region) <= 40, 'Next 20', 'Rest'))
3.If(Aggr(Rank(TOTAL Sum(Sales), 1, 1), Product) <= 20, 'Top 20', If(Aggr(Rank(TOTAL Sum(Sales), 1, 1), Product) > 20 and Aggr(Rank(TOTAL Sum(Sales), 1, 1), Product) <= 40, 'Next 20', 'Rest'))
None of the expressions above are producing the desired results. could you please provide some guidance on the issue?
try this,
Aggr(
If(Rank(TOTAL Sum(Sales), 1, 1) <= 20, 'Top 20',
If(Rank(TOTAL Sum(Sales), 1, 1) > 20 and Rank(TOTAL Sum(Sales), 1, 1) <= 40, 'Next 20', 'Rest')
),
Region, (TOTAL <Region>)
)