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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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

Labels (1)
17 Replies
Clever_Anjos
Support
Support

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]) )