Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Note: You may notice some temporary visual or styling issues in the Community. Our vendor is actively investigating.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to find min sales value of product?

sales1:

LOAD * Inline

[

product,sales

a,10

b,10

c,30

d,40

a,10

b,10

c,30

d,40

a,10

b,10

c,30

d,40

]

I have the above table

how will i get min sales value of a Product form the above table in Text object.

Output should be:   a,b  

3 Replies
sunny_talwar

Try this:

=Concat(If(Aggr(Rank(-Sum(sales), 0, 1), product) = 1, product), ',')

datanibbler
Champion
Champion

Hi Gaurav,

one possibility would be to sort it ascending by product (primary) and ascending by sales_value (secondary), that way the minimum value of any product would be on top - then you'd have to split this table into one per product and then you could use the PEEK function to make the minimum sales_value per product into a variable - and those variables could be shown in text objects on the GUI.

HTH

kavita25
Partner - Specialist
Partner - Specialist

Try the below expression:

=Concat(Aggr(If(min(sales), product), product))

Regards,

Kavita