Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
idogridish2
Creator III
Creator III

count customer that paid the minimum price

Hi,

how can i count in the layout the number of customer that paid the minimum price in each company?

i added a sample data/

my culc is wrong in the sample.

thanks.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

With a selection in company, you can make it work using

=Count({$<Customer={"=PRICE=min(TOTAL PRICE)"}>}Customer)

But I guess you want have this expression consider the dimensional value of company, potentially for all companies.

Without a change to the script, you can use

=Sum( Aggr( If(PRICE = Min(TOTAL<Company> PRICE), 1), Company, Customer))

View solution in original post

3 Replies
swuehl
MVP
MVP

With a selection in company, you can make it work using

=Count({$<Customer={"=PRICE=min(TOTAL PRICE)"}>}Customer)

But I guess you want have this expression consider the dimensional value of company, potentially for all companies.

Without a change to the script, you can use

=Sum( Aggr( If(PRICE = Min(TOTAL<Company> PRICE), 1), Company, Customer))

sunilkumarqv
Specialist II
Specialist II

Please try this

Count (Distinct aggr(Min(Total PRICE),Customer))


tyagishaila
Specialist
Specialist

Sum({$<PRICE={"$(=$(vMinPrice))"}>}Customer)

where variable

vMinPrice=Min(PRICE)