Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
nikhilgarg
Specialist II
Specialist II

First Sorted Value

I want to find out Customer name corresponding to lowest unit price. I am using following syntax but an error is showing. Can anyone tell me the correct solution ??

FirstSortedValue(Customer,Min(UnitPrice))

6 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Usually, that should be:

FirstSortedValue(Customer, UnitPrice)


HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
nikhilgarg
Specialist II
Specialist II
Author

HEy,

Still it is not working and i want Customer with minimum UnitPrice then i think min() should be used , right ??

jonathandienst
Partner - Champion III
Partner - Champion III

No, FirstSortedValue will find the min for you. But if that is not working, then you need to post a sample of your model so that we can looks at the why its not working (data structure or sheet object related)

You may need to do this in the load script if you have items with null or zero UnitPrice, or many items with the same (minimum) unit price. Or perhaps this works:

FirstSortedValue(Customer, Aggr(Min(UnitPrice), Customer))

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
nikhilgarg
Specialist II
Specialist II
Author

HEy,

I ahve attached the qvw file , so kindly see it and let me know..

jonathandienst
Partner - Champion III
Partner - Champion III

Not sure what you are trying to achieve - as you have Customer and UnitPrice as dimensions in your chart, there is no purpose to the FirstSortedValue.

I have added a straight table using product and finding the customer with the lowest unit price for the product.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
nikhilgarg
Specialist II
Specialist II
Author

WHile using QVSource, I used linkedin connector and loggedin with a id. It gets authenticated but no data is shown. I dont know what to do. Please tell me how it works. I am using free version of QVSource.