Qlik Community

Qlik Education Discussions

Discussion Board for collaboration related to Qlik Education.

nikhilgarg
Contributor III

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
MVP
MVP

Re: First Sorted Value

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
Contributor III

Re: First Sorted Value

HEy,

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

MVP
MVP

Re: First Sorted Value

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
Contributor III

Re: First Sorted Value

HEy,

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

MVP
MVP

Re: Re: First Sorted Value

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
Contributor III

Re: Re: First Sorted Value

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.

Community Browser