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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
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

1 Solution

Accepted Solutions
sunny_talwar

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

Capture.PNG

View solution in original post

27 Replies
tresesco
MVP
MVP

May be this?

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

sunny_talwar

Will that work without the Aggr() Tresesco?

sunny_talwar

Shouldn't it be this

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

tresesco
MVP
MVP

It should, because TOTAL is there.

sunny_talwar

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

For some reason, it did not work for me

Capture.PNG

sunny_talwar

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