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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

sum(amount) of previous month

Hi,

i need help. I have a table F0902 with fields month, Id, Company, Amount.

I want to get the sum of amount when i click on month ListBox.

i.e when i select

- March i want to get : amount of January+February+March

-July i want to get : amount of January+February+March+April+May+June+July

-...

How can I do ? Please help.

thanks

3 Replies
swuehl
MVP
MVP

I believe you could use set analysis to do this kind of point in time or YTD analysis.

Please check this post:

http://community.qlik.com/message/2255

and if you are not famliar with set analysis, the Help pages. I found this blog also quite useful:

http://iqlik.wordpress.com/2010/11/27/the-magic-of-set-analysis-point-in-time-reporting/

Hope this helps,

Stefan

Not applicable
Author

Use this expression = Sum({<Month = {"<=$(vMaxMonth)"}>} Amount) and Create a new variable with this expresion =Max(Month) including =

Or  try use this expression = Sum({<Month = {"<=$(=Max(Month))"}>} Amount) withot create a variable

Anonymous
Not applicable
Author

try this set analysis

sum({<month={'<=' & 'num(month)'}>}Amount)

num(month) should be the months in your header, so check the specification

I prefer to define a variable:

vSelectedMonth = '<=' & num(month(XYZ)) where XYZ is the field of your selection month

and then

sum({<month={'$(vSelectedMonth)'}>}

hope this helps