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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register 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
Former Employee
Former 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
Former Employee
Former 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.