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: 
markticoy
Partner - Contributor III
Partner - Contributor III

SUM from beginning of time

Hi All,

I am having trouble getting sum of values from the first record of my source up to the current selection.

I have tried using in my set analysis the ff:

SUM(${<Year={'<=$(=Max(Year))'},Month={'<= $(=Max(Month))'}>})

TIA

12 Replies
Not applicable

hi,

SUM(${<Year={'<=$(=Max(Year))'},Month={'<= $(=Max(Month))'}>}sales)


check have u missed action field in your set analysis...


Not applicable

hi,

if you want to sum of record from starting to till date then you have to by pass year,month and day

sum({$< year=, month=, day=}> value)

SUM({$<Year={'<=$(=Max(Year))'},Month={'<= $(=Max(Month))'}>} value) this will give you max month value.

Regards

Vimlesh

danieloberbilli
Specialist II
Specialist II

try to move the first dollar behind < , use " " and you are missing the actual field to sum e.g. SALES

SUM({$<Year={"<=$(=Max(Year))"},Month={"<= $(=Max(Month))"}>} SALES)

markticoy
Partner - Contributor III
Partner - Contributor III
Author

isn't is the same with the one i'm currently using ?

PrashantSangle

Hi,

You are missing the valueName which you are summing

SUM(${<Year={'<=$(=Max(Year))'},Month={'<= $(=Max(Month))'}>}sales)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
markticoy
Partner - Contributor III
Partner - Contributor III
Author

on my expression on the app, there is a 'ValueName' stated as 'VAT Ex', but i'm having a hard time on getting the sum of total from, let's say January 2012 to February 2014, January 2012 is fixed but February 2014 is dynamic

PrashantSangle

Hi,

Can you post sample apps.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable

May be you need like below ,

rather than taking year month day take date field from database in set analysis

sum({<date={"<=$(=max(date))"},month1=,day1=,year1=>}sales)

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

The issue you have is that the month field is most likely just the month part of the date, eg. Apr.  So, the <= Max(month) will only be pulling back values from Jan-April - regardless of year.

You should use Set Analysis to ignore selections on Year and Month (and any other date fields you have) and go for less than or equal to the date.

The code will be something like:

sum({<Year=,Month=,Day=,Date={"<=$(max(Date)"}>}Value)

Date formats can be a challenge in set analysis, but that will get you closer.

Hope that helps.

Steve