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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

FirstSortedValue

Hello All,

My requirement is to get only the records highlighted in yellow with the bold font as in the image attached.

Essentially if a record is amended the its ID get updated i.e ; followed by the number of times.So in such instances I only want the most recent update. thus the expression ;

=FIRSTSORTEDVALUE(AGGR(SUM(DISTINCT AMOUNT),CLIENT,ID)
,
-
AGGR(SUM([AMENDMENT NUMBER]),CLIENT,ID)) where Amendment number is derived as MID(ID,14,3)) AS [AMENDMENT NUMBER].

But unfortunately this fails to work for client's with no amendment like Moses, Victor just a few.

Please help, Thanks

image.PNG

13 Replies
Anonymous
Not applicable
Author

As request please find attached.

sunny_talwar

This seems like the data you have in the chart, I would rather look at the aggregated data or the your qvw application

Anonymous
Not applicable
Author

Sunny, PFA.

sunny_talwar

This may be?

=FirstSortedValue(Aggr(SUM(DISTINCT AMOUNT),iCustomer_ID, NEW_ID, [AMENDMENT NUMBER]), -Aggr([AMENDMENT NUMBER], iCustomer_ID, NEW_ID, [AMENDMENT NUMBER]))

Capture.PNG