Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
HenrikSievers
Contributor
Contributor

Aggr() sorting of numerical field comes out in text order

I have a pivot table with 2 dimensions, market and production group.

For each combination I want to show how many customers make up 80% of sales in for that combination.

I am trying to follow the recipe for pareto analysis given by HiC Recipe for a Pareto Analysis – Revisited

However it does not work.

I have been able to locate the issue to the sorting in the aggr().

Using Concat to get the output of the Aggr:

Concat(
Aggr(
Sum([Forecast 2019-2020]),
([Forecast 2019-2020],(NUMERIC,REVERSE))
)
,'/')

But output seems to be sorted as text 

-0/-2144/-2764/-3937/-5/-5967/-824/0/0/0/10/100/100/1001/10014/1001728/1002/10025/1005/10066/1009/101/1011/1012/...

Any ideas how to fix this?

Labels (2)
1 Solution

Accepted Solutions
edwin
Master II
Master II

it appears you are tricking the AGGR function into creating a table of your FORECAST fields.  so if i get it right, you just want a straight concat of your field ordered numericaly.  use concat ordering using weighted value:

concat([Forecast 2019-2020], '/', [Forecast 2019-2020])

where the last field is the ordering.  

https://help.qlik.com/en-US/qlikview/April2020/Subsystems/Client/Content/QV_QlikView/Scripting/Strin...

i learned this from another post which i cant find rt now

View solution in original post

3 Replies
edwin
Master II
Master II

it appears you are tricking the AGGR function into creating a table of your FORECAST fields.  so if i get it right, you just want a straight concat of your field ordered numericaly.  use concat ordering using weighted value:

concat([Forecast 2019-2020], '/', [Forecast 2019-2020])

where the last field is the ordering.  

https://help.qlik.com/en-US/qlikview/April2020/Subsystems/Client/Content/QV_QlikView/Scripting/Strin...

i learned this from another post which i cant find rt now

edwin
Master II
Master II

HenrikSievers
Contributor
Contributor
Author

Thanks.

Does it mean the concat function actually spoils the sorting of the aggr ?

Because I don't really need the concat, it is only a way to see the output of the aggr sorting.