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: 
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, ', ')