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: 
Not applicable

Summing all values with a date less than dimension

A simplified version of what I am trying to accomplish:

Data Sample:

Date, Value       

1/1/2012,10

1/2/2012,20

1/3/2012,30

1/4/2012,90

1/5/2012,100

I would like to plot Date on the X Axis.  On the Y axis, I would like to plot the Sum of value where Date <= Dimension value.  For example:  on the date 1/4/2012, i would like to see the value 150.  On 1/2/2012, i would like to see 30.  If I click on a single date i should still be able to see the correct total (ie if i select and dispplay only 1/4/2012 I should still be able to see the value of 150)

I have tried using TOTAL in my sum expressions, but this is plotting the total across all dimension values. 

Please advise.  Thanks,


Andrew

1 Solution

Accepted Solutions
Not applicable
Author

Try this:

=if(GetSelectedCount(Date)=1,
aggr(rangesum(above(sum({1}Value),0,500)),Date),
rangesum(above(sum(Value), 0, rowno())))

View solution in original post

4 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try: rangesum(above(sum(Value),0,RowNo()))

See attached example


talk is cheap, supply exceeds demand
Not applicable
Author

Try this:

=if(GetSelectedCount(Date)=1,
aggr(rangesum(above(sum({1}Value),0,500)),Date),
rangesum(above(sum(Value), 0, rowno())))

Not applicable
Author

Example File.

Not applicable
Author

Thanks to you both for the quick replies!