Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Bottom function

Hi,

I have a chart that shows the top 10 customers using this dimension:

=If(aggr(rank(aggr(sum({<SYS_ID*={'BOOK_WIRE_1LINK', 'WIRE_DOMESTIC_1LINK', 'WIRE_INTERNATIONAL_1LINK', 'ADVANCE_1LINK', 'SK_1LINK'}>} TXN_COUNT), CUST_NO), 4, 2), CUST_NAME) <= 10, CUST_NAME)

I'd also like to show the bottom 10 customers. I think I need to use the bottom function but this is not getting me what I need:

=If(aggr(bottom(aggr(sum({<SYS_ID*={'BOOK_WIRE_1LINK', 'WIRE_DOMESTIC_1LINK', 'WIRE_INTERNATIONAL_1LINK', 'ADVANCE_1LINK', 'SK_1LINK'}>} TXN_COUNT), CUST_NO), 4, 2), CUST_NAME) <= 10, CUST_NAME)

I need help with the syntax. Any help would be greatly appreciated.

Thanks,

Shannon

1 Reply
johnw
Champion III
Champion III

You can get the bottom 10 customers with rank by just reversing the sign. So I suspect something along these lines would work:

if(aggr(rank( sum(...)),CUST_NAME)<=10
or aggr(rank(-sum(...)),CUST_NAME)<=10,CUST_NAME)