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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
nikhilgarg
Specialist II
Specialist II

WHat is the FirstSortedValue()

Hey,

WHat is the FirstSortedValue() ?? Can anyone explain with example ??

Thanks

15 Replies
Not applicable

If you got your answer, kindly mark helpful or correct answer and close the post.

Regards

Not applicable

hi,

firstsortedvalue () ,  is nothing but we can work on two perameters .

1). string value

2). numeric value,(only stright table & pivot table) it ;ll work.

For Example:

1).firstsortedvalue(name,-sales) it 'll display the lowest value in  the sales  

2).firstsortedvalue(name,sales) it 'll display the highest value in  the sales

Not applicable

nerchukuntunnara leka working in any org?

Not applicable

em enduku ..............

Not applicable

urkane brother

jerem1234
Specialist II
Specialist II

Just to clear up the use of the "-" symbol in the second parameter. When the negative symbol is used, it will sort the maximum to be first. If it is left out, it sorts the minimum to be first.

So for something like:

Group    Day          Value

A              1              100

A              2              75

A              3              20

if we do:

FirstSortedValue(Day, Value)    ------- returns  3

FirstSortedValue(Day, -Value)  ------- returns 1


From Qlikview Help:

firstsortedvalue([{set_expression}][ distinct ] [ total [<fld {, fld}>]] expression [, sort_weight [, n]])

returns the first value of expression sorted by corresponding sort-weight when expression is iterated over the chart dimension(s). Sort-weight should return a numeric value where the lowest value will render the corresponding value of expression to be sorted first. By preceding the sort-value expression with a minus sign, the function will return the last value instead. If more than one value of expression share the same lowest sort-order, the function will return null. By stating an n larger than 1, you will get the nth value in order.

Hope this helps!