Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
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

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

You can then use the formula:

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

Good to know it works!

View solution in original post

16 Replies
tresesco
MVP
MVP

You can try chart expression property for that, like:

Untitled.png

Anonymous
Not applicable
Author

Thank you tresesco, but i am using Qliksense

Cheers

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Or try doing like this in the expression:

=sum({<Date = {">=$(=Addmonths(today(), -3))"}>}budget)

Anonymous
Not applicable
Author

Hi Mindaugas Bacius

Thanks

However, my idea is to sum the first 5 months or x numbers of months of the year, the number of months should be based in another field of the excel sheet that contains the up-to-date date value.

Cheers

sunny_talwar

I guess the question is what is your dimension? Where are you trying to do this? Can you provide more details here?

Anonymous
Not applicable
Author

Hi Sunny T,

It is very simple, i have a field called "Accountdate" with the each of the months of the year and a field called "Budget", on my Qlik Sense sheet i have a filter pane with the name of the countries (another field) called "Countries".

So what i am trying to achieve in a #1 KPI is to get the sum of the first x months of the budget. in the 1# KPI the only thing i have is the expression as measure: sum({$<Date={'$(=max([Accountdate]))'}>} budget)

Cheers

Anonymous
Not applicable
Author

I don't know if this works for you, but you could try this for getting the sum of the first three months.The syntax for the date (01-04-2016) may vary per country/excel file. I'm not sure about that.

sum({$<Date={'<01-04-2016'}>}Budget)

sunny_talwar

I think we do get the idea of what might be needed, but there are still gaps related to the "another field" of the excel sheet. Is there only going to be one value or will there be multiple values in it? I guess seeing some sample data may help explain a lot of the doubts we might have and provide you a solution which might work the best for you.

Best,

Sunny

Anonymous
Not applicable
Author

Hi Sunny T. Below you will find a sample of the data I am using. Thank again for your help

Budgetsample.png