Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
agni_gold
Specialist III
Specialist III

FirstSortedValue

Hi ,

I am using below expression for calculating sale in maximum date.

=FirstSortedValue({<[ERP Amount USD] -= {0}>} [ERP Amount USD],-[Invoice Date])

But it is returning null values for some rows.

Regards,

Agnivesh

@Sunny T

gwassenaar

17 Replies
Clever_Anjos
Employee
Employee

Try

FirstSortedValue({<[ERP Amount USD] -= {0}>} [ERP Amount USD],-[Invoice Date] + [ERP Amount USD]/1000000 )

agni_gold
Specialist III
Specialist III
Author

No result !!

Chanty4u
MVP
MVP

cn u share sample qvw?

agni_gold
Specialist III
Specialist III
Author

Hi ,

I am creating a straight table , in which one dimension is present and i have added one expression to find max date using below expression

=Max({<[ERP Amount USD] -= {0}>}[Invoice Date])

Now i want second expression that , on above date sum(ERP Amount USD)

Chanty4u
MVP
MVP

=Concat(DISTINCT

Aggr( If([ERP Amount USD]= Max([ERP Amount USD]), [Invoice Date], [ERP Amount USD])

,', ')

agni_gold
Specialist III
Specialist III
Author

Thanks but it is also not working

why below expression is not working

=sum({<[Invoice Date] = {"$(=max({<[ERP Amount USD]-={0}>}[Invoice Date]))"}>}[ERP Amount USD])

Chanty4u
MVP
MVP

try to recheck wit ur data usng metrics in Textbox one by one

agni_gold
Specialist III
Specialist III
Author

Thanks for all your valuable help :

I got answer from below discussion

/thread/81101

Now my problem has been resolved using below expression

=FirstSortedValue( aggr(sum([ERP Amount USD]),[HFM Entity],[Invoice Date]), -aggr(Max({<[ERP Amount USD]-={0}>}[Invoice Date]),[HFM Entity],[Invoice Date]) )