Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Set Analysis: Customer with min sales

I am attempting to to display the customer with the minimum sales with set analysis and I am having trouble. So if I am using the KPI object and have 2 customers like Cust1 (sales = 80000) and Cust2 (sales = 90000) I want to have the KPI object display Cust1.

Any help would be appreciated. Thanks!

4 Replies
eduardo_sommer
Valued Contributor

Re: Set Analysis: Customer with min sales

This may help

=only({$<Sales={$(=min(Sales))}>} Customer)

considering Sales as the field with total sales of customer and Customer as the name of the Customer

If two or more customers have the same Sales as the min(Sales), the only function will return a null

Eduardo

MVP
MVP

Re: Set Analysis: Customer with min sales

May be this:

=FirstSortedValue(Customer, sales)

or

=FirstSortedValue(Customer, Aggr(Sum(sales), Customer))

Not applicable

Re: Set Analysis: Customer with min sales

Definitely this is the answer , I've tried:


=FirstSortedValue(Customer, TotalSales)

balrajahlawat
Esteemed Contributor

Re: Set Analysis: Customer with min sales

what about this:

=aggr(min(sum(Sales)), Customer)

Community Browser