Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

adoteykwame
Contributor

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

Re: Firstsortedvalue (Grand Total) issue

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

Capture.PNG

27 Replies
MVP
MVP

Re: Firstsortedvalue (Grand Total) issue

May be this?

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

Re: Firstsortedvalue (Grand Total) issue

Will that work without the Aggr() Tresesco?

Re: Firstsortedvalue (Grand Total) issue

Shouldn't it be this

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

MVP
MVP

Re: Firstsortedvalue (Grand Total) issue

It should, because TOTAL is there.

Re: Firstsortedvalue (Grand Total) issue

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

adoteykwame
Contributor

Re: Firstsortedvalue (Grand Total) issue

Tried something quite similar "Nested aggregation"

adoteykwame
Contributor

Re: Firstsortedvalue (Grand Total) issue

That expression return "0"

Re: Firstsortedvalue (Grand Total) issue

For some reason, it did not work for me

Capture.PNG

Re: Firstsortedvalue (Grand Total) issue

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

Community Browser