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: 
qlikviewwizard
Master II
Master II

Why to give negative value in FirstSortedValue

Hi All,

Why to give negative sign for HIREDATE in FirstSortedValue function.

Expression: FirstSortedValue(SAL, -HIREDATE)

Thanks in advance.

1 Solution

Accepted Solutions
JonnyPoole
Employee
Employee

The 2nd arguement provides the field to sort. The sort order is always ascending. So if you want to sort in descending order (so that you get the most recent date first) , then just put a negative in front of the 2nd argument.

If HireDate is recognized by qlik as a date field it will sort it numerically.

View solution in original post

2 Replies
JonnyPoole
Employee
Employee

The 2nd arguement provides the field to sort. The sort order is always ascending. So if you want to sort in descending order (so that you get the most recent date first) , then just put a negative in front of the 2nd argument.

If HireDate is recognized by qlik as a date field it will sort it numerically.

Not applicable

Hi,

Why negative sign in first sorted value is:

BY PRECEDING THE SORT VALUE EXPRESSION WITH THE "MINUS SIGN", THE FUNCTION WILL  RETURNS THE HIGHEST VALUE.