Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Sum values up to x numbers of months

Hello and thanks for helping me.

I want to sum the values of an excel spreadsheet but accumulated only up to x number of months, do not want the whole year. I have tried sum({$<Date={'$(=max([Accountdate]))'}>} budget) but it is not working,

Please

16 Replies
Anonymous
Not applicable
Author

Try this:

You have to add a ID field in your table, unique for each row.


sum({$<ID={"=(Accountdate=MAX(DateRange))"}>}Budget)

DateRange refers to your other table where the latest date is stored.

Greetings,

Timo

Anonymous
Not applicable
Author

HI Timo, i have tried but no luck, i did add another field in my table but the results is totally wrong

Thanks

Anonymous
Not applicable
Author

Maybe it has to do with the dateformat.

Here you find my QlikSense file. Check my settings in the load script.

Hope it helps.

Greetings,

Timo

Anonymous
Not applicable
Author

I have the same date as you are in your example, I managed to get the sum of the values with the same date (in your example 115 corresponds to Mar 2016), but I need to get the sum of values of the previous months as well including the latest.

Cheers

Anonymous
Not applicable
Author

You can then use the formula:

sum({$<ID={"=(Accountdate<=MAX(DateRange))"}>}Budget)

Good to know it works!

Anonymous
Not applicable
Author

Hi Time Schrama,

Thanks a lot for your help. it works perfectly!!!@

Thank for taking the time.

Cheers

oknotsen
Master III
Master III

If your question is now answered, please flag the Correct Answer (via the big "Correct Answer" button near every post) and Helpful Answers (found under the Actions menu under every post).

If not, please make clear what part of this topic you still need help with .

... O... and don't mark your own "thank you" post as Helpful... as it is not.

May you live in interesting times!