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

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Firstsortedvalue (Grand Total) issue

Hi Guys,


How do I sum the resultant of this expression to display in a textbox?


=FirstSortedValue(Aggr(Sum(FIELDNAME1),FIELDNAME2), -FIELDNAME2).


Thanks

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

It seems that if it is done in the inner aggregation, it works

Capture.PNG

View solution in original post

27 Replies
tresB
Champion III
Champion III

May be this?

=Sum( Total FirstSortedValue(Aggr(Sum(FIELDNAME1),FIELDNAME2), -FIELDNAME2))

sunny_talwar
MVP
MVP

Will that work without the Aggr() Tresesco?

sunny_talwar
MVP
MVP

Shouldn't it be this

=Sum(Aggr(FirstSortedValue(Aggr(Sum(FIELDNAME1),FIELDNAME2), -FIELDNAME2), FIELDNAME2))

tresB
Champion III
Champion III

It should, because TOTAL is there.

sunny_talwar
MVP
MVP

I did not know that by using TOTAL you can avoid using an Aggr. I will try to test this out. Thanks

Anonymous
Not applicable
Author

Tried something quite similar "Nested aggregation"

Anonymous
Not applicable
Author

That expression return "0"

sunny_talwar
MVP
MVP

For some reason, it did not work for me

Capture.PNG

sunny_talwar
MVP
MVP

Would you be able to share an image of the chart where you are using this?