Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
cristian_av
Creator III
Creator III

Set Analysis to Sum Values from the day before of the latest Selected

Hi

I need to make an expression using Set Analysis which Sum the values of the day before of the latest one Selected.

The field is %Date.

An explanation...

I have a field (%Date) wich contains all the possible dates for my data.

I want to do a comparison betweeen the latest day selected and one day back (yesterday), one week back, and so on...

The expression I'm actually using for Today is:

          =Sum(ContadorConsumos)

How can I modify the sum to consider N days back of the maxium day selected?


Pseudocode:

=Sum({%Date=%Date-NDays} ContadorConsumos)


Thanks!!

1 Solution

Accepted Solutions
maxgro
MVP
MVP

1 day back

sum ({$ <%Date={"$(=date(max(%Date)-1))"}>} ContadorConsumos)

or without date (bold)

View solution in original post

3 Replies
gmoraleswit
Partner - Creator II
Partner - Creator II

This blog can be helpful:

Relative Calendar Fields

maxgro
MVP
MVP

1 day back

sum ({$ <%Date={"$(=date(max(%Date)-1))"}>} ContadorConsumos)

or without date (bold)

cristian_av
Creator III
Creator III
Author

Thanks!

Altought I was a bit confussed at beginning, because my fieldname is %Date, and you use the date() function.

Finally it started working!