Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikView forum consolidation is complete. Labels are now required. LEARN ABOUT LABELS
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
Partner

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)

View solution in original post

cristian_av
Creator III
Creator III

Thanks!

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

Finally it started working!