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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Top 3 values and corresponding attributes

I'm fairly new to Qlikview and I need help with an expression.  I have a table box where I have values for product, source  and destination and costs associated... I need expression for a chart which will calculate the three cheapest costs separately and then another expression that would be give me the source for those 3 cheapest costs separately... If you could point me in the right direction or give me some help, I would greatly appreciate it.

This is what the table box essentially looks like....

ProductSourceDestinationCost
HandbagAA110
Handbag2BB120
Handbag3CC130
Handbag4DD140
Handbag5EE150
3 Replies
MK_QSL
MVP
MVP

For Min Cost

Min(Cost,1)

Min(Cost,2)

Min(Cost,3)

For Souce

=FirstSortedValue(Source,Cost,1)

=FirstSortedValue(Source,Cost,2)

=FirstSortedValue(Source,Cost,3)

MK_QSL
MVP
MVP

If you found your answer, please close the thread by selecting correct/helpful answer, so that other users can use it..

Not applicable
Author

ProductSourceDestinationCostCost 2Total Cost
HandbagAA10

5

5
Handbag2BB1101020
Handbag3CC1201535
Handbag4DD1301040
Handbag5EE1402060

Right now, I'm using the above example where I'm using =FirstSortedValue(Source, [Total Cost],1)

Is there any way that if my data had 0 as one of the cost, not to include it as the cheapest source?

For example, the cheapest source would be B, C, and D.