Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Now Live: Qlik Sense SaaS Simplified Authoring – Analytics Creation for Everyone: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
shane_spencer
Specialist
Specialist

Concat DISTINCT with sort-weight

I need help with of Concat Discinct of a Field with a Sort-Weight?

The default is A-Z.

i.e.

shane_spencer_0-1594718479940.jpeg

What I want is to sort by Total Absolute amount

i.e. The sort order should be as per below

shane_spencer_1-1594718479944.jpeg

But the best I can get is sorted by individual Absolute Amount – so it’s not distinct, values are repeated

i.e.

shane_spencer_2-1594718479948.jpeg

it's sorted like below (not the Sum of the Amounts)

shane_spencer_3-1594718479951.jpeg

I think the answer maybe something to do with Aggr but I can’t work it out. Any ideas? See attached for sample data.

Labels (3)
1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try :

=Concat(Distinct GL_ACCOUNT_CODE_src_1,';', -Fabs(Aggr(NODISTINCT Sum(AMT_NET_TAXREP_src_1),TRANS_INVOICE_NUMBER_src_1,GL_ACCOUNT_CODE_src_1)) )

View solution in original post

3 Replies
tresesco
MVP
MVP

Try :

=Concat(Distinct GL_ACCOUNT_CODE_src_1,';', -Fabs(Aggr(NODISTINCT Sum(AMT_NET_TAXREP_src_1),TRANS_INVOICE_NUMBER_src_1,GL_ACCOUNT_CODE_src_1)) )

shane_spencer
Specialist
Specialist
Author

Thanks - that worked! Are you able to explain what it's doing / why inparticular I need the NODISTINCT ?

shane_spencer
Specialist
Specialist
Author

Is there a way to do the same in the script?