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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to sum values past

Hello.

I was wondering, whats the proper format of the expressión, in order to Sum only the values previuos from today.

for Example, i got all the planned values of the year. How can i only sum those that are previuos from today?

Any ideas?

Do i make myself clear?

thanks,

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

Assuming you have 1 straight table with DateField and PlannedValue (and eventually other fields): some possibilities

Sum(if(DateField<Today(), PlannedValue))

Or

-Sum((DateField<Today())*PlannedValue)

There are several other ways. If it doesn't work, please post some sample data.

Hope this helps.

View solution in original post

3 Replies
Not applicable
Author

Hi,

Assuming you have 1 straight table with DateField and PlannedValue (and eventually other fields): some possibilities

Sum(if(DateField<Today(), PlannedValue))

Or

-Sum((DateField<Today())*PlannedValue)

There are several other ways. If it doesn't work, please post some sample data.

Hope this helps.

maxgro
MVP
MVP

or with set analysis

sum({$ <Date={"<$(=floor(Today()))"}>} PlannedValue )

ashwanin
Specialist
Specialist

sum({<date={">=$(=AddMonths(Max(date-6),0))<=$(=Max(date))"}>} Values)