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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
G3S
Creator III
Creator III

Cumulative of an aggregated value

hi,

There is a value (TEU) calculated using the following expression: 

sum(aggr(([CntrTEU]),[CntrSeal])).

I need the cumulative value of this value based on a selected date (ShippedTEU).  The modifier feature assists, however all dates up to the required date need to be selected. 

I want to be able to select a particular date and anything preceding that to be considered automatically. 

G3S_1-1598345467079.png

 

in the above table,  to get cumulative for 25/4/2020, I have to select all 4 dates. If I select only 25/4/2020, ShippedTEU returns 1396. 

What is the expression (even if set analysis) to return 5657 by selecting only 25/4/2020

thanks in advance.

 

 

 

Labels (3)
14 Replies
sunny_talwar

What expression are you using in the charts above?

G3S
Creator III
Creator III
Author

ETSWkEndDate = ETSWkEndDate

TEU = sum(aggr(([CntrTEU]),[CntrSeal]))

Shipped TEU = sum(aggr(([CntrTEU]),[CntrSeal]))   with Accumulation modifier set to full range

Sunny_Talwar: Sum({1<ETSWkEndDate = {"<=$(=Date(Max(ETSWkEndDate), 'D/M/YYYY'))"}>} Aggr( CntrTEU, CntrSeal))

Kushal_Chawda

@G3S  did you try my latest reply?

G3S
Creator III
Creator III
Author

Yes I did, but it didn't work.

I will be playing around with it more today..  Thank you for showing about variables. 

G3S
Creator III
Creator III
Author

the variable & expression added same as you suggested.  works as a total, but only adds upto the prev week. similar result like what i posted for Sunny_talwar. 

Capture.JPG

selecting single week results in 0. 

 

is there a way in set analysis to say get the selected value in ETSWkEndDate and also include any ETSWkEndDate values that are less than the current selected value?