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

Announcements
Solving the Informatica Dilemma: On-Demand Briefing - Watch On Demand!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Is there a 'Lastsortedvalue' type function?

I have 3 fields

Client

Month

Revenue

I'm trying to pull into a straight table a chart that will list the CLIENTS and show REVENUE for the latest month where the client had revenues.

Some clients don't have revenues in the latest month and instead of showing a blank, I'd like to show the monthly revenue for the latest month where it existed.

firstsortedvalue does the trick for the earliest month, but is there a function for the latest month?

Thanks in advance!

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Use a negated sort weight, like -1 * MONTH as second argument to FirstSortedValue or just -MONTH:

=FirstSortedValue ( VALUE, -MONTH)

View solution in original post

4 Replies
swuehl
MVP
MVP

Use a negated sort weight, like -1 * MONTH as second argument to FirstSortedValue or just -MONTH:

=FirstSortedValue ( VALUE, -MONTH)

Not applicable
Author

I just saw that and it worked great.  Thank you!

alexC
Contributor II
Contributor II

Hi,

 

it doesnt work for me.
it work for "first" but not for "last" using "-"

 

FirstSortedValue(
{<update_date = {"<01/10/2024"}>}
subscription_status & ' (' & update_datetime & ')',
update_datetime_num
)

 

what do i do wrong?

BrunPierre
Partner - Master
Partner - Master

@alexCyou should reverse the sort order using a negative sort weight and make sure it's a proper numeric timestamp.

-update_datetime_num