Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
shivani_singhal
New Contributor II

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
laddu_927
Valued Contributor

Re: Output of the expression

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

8 Replies
laddu_927
Valued Contributor

Re: Output of the expression

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

shivani_singhal
New Contributor II

Re: Output of the expression

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

Also.. what does (-Paid_Date) indicate?

laddu_927
Valued Contributor

Re: Output of the expression

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
New Contributor II

Re: Output of the expression

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?

roharoha
Valued Contributor III

Re: Output of the expression

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

shivani_singhal
New Contributor II

Re: Output of the expression

Thanks Robin. I got my answer.

laddu_927
Valued Contributor

Re: Output of the expression

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

shivani_singhal
New Contributor II

Re: Output of the expression

Thank you so much Shiva for solving this query.

Community Browser