Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
muthukumar77
Partner - Creator III
Partner - Creator III

get 2 lowest Customer name

Hi,

I need to get 2 lowest sales Customer name in text box.

I tried to do a expression but its not working.

=only(if(Aggr(rank(Sum(-NetSales)),Customer_CompanyName)=1, Customer_CompanyName))

Can anyone pls tell what is problem?

Muthukumar Pandiyan
1 Solution

Accepted Solutions
devarasu07
Master II
Master II

Hi,

Try like below,

=Concat(DISTINCT Aggr(If(Rank(-Sum(Measure)) <=2, Product), Product), ', ')

11.png

View solution in original post

3 Replies
sunny_talwar

May be try with FirstSortedValue()

Customer with lowest Sales

FirstSortedValue(Customer_CompanyName, Aggr(Sum(NetSales), Customer_CompanyName))

Customer with 2nd lowest Sales

FirstSortedValue(Customer_CompanyName, Aggr(Sum(NetSales), Customer_CompanyName), 2)

devarasu07
Master II
Master II

Hi,

Try like below,

=Concat(DISTINCT Aggr(If(Rank(-Sum(Measure)) <=2, Product), Product), ', ')

11.png

sunny_talwar

Can also be done using set analysis

=Concat(DISTINCT {<Product = {"=Rank(-Sum(Measure)) < 3"}>}Product, ', ')