Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
shivani_singhal
Partner - Contributor III
Partner - Contributor III

Output of the expression

What is the exact meaning of this expression and what will be the output?

=FirstSortedValue({<Paid_Date = {"<=$(=Date(Upto,'D/M/YYYY')) "}>} Outstanding,-Paid_Date)

1 Solution

Accepted Solutions
Anonymous
Not applicable

It gives the 1st value of the Outstanding with the max Paid_Date  which is less that the selected Upto Date.

View solution in original post

8 Replies
Anonymous
Not applicable

It gives the 1st value of the Outstanding with the max Paid_Date  which is less that the selected Upto Date.

shivani_singhal
Partner - Contributor III
Partner - Contributor III
Author

Could you please explain how its giving me the maximum paid date.

Also.. what does (-Paid_Date) indicate?

Anonymous
Not applicable

Imagine you have the following table:

FieldA, FieldB

A, 3

B, 4

C, 1

D, 2

If you run a FirstSortedValue(FieldA, FieldB) you'll get the first sorted value from FieldA based on the sorting of FieldB. Value 1 is the first value for FieldB so the function will in this example return C. (FirstSortedValue())

So if we keep "-" before the field B, it will be sorted in reverse order, returning B which is value for Max value in FieldB.

Same is the case with PaidDate(field B) and outstanding(Field A).

And again set analysis is applied to filter the values based on FieldB.

shivani_singhal
Partner - Contributor III
Partner - Contributor III
Author

So..it will fetch the latest Paid_Date and will give the outstanding on the basis of this latest Paid_Date...Am I right Shiva?

Anonymous
Not applicable

... as long as there's exactly one distinct value matching...

shivani_singhal
Partner - Contributor III
Partner - Contributor III
Author

Thanks Robin. I got my answer.

Anonymous
Not applicable

Latest paid Date which is less than selected "Upto" value

shivani_singhal
Partner - Contributor III
Partner - Contributor III
Author

Thank you so much Shiva for solving this query.