Qlik Community

Ask a Question

New to QlikView

If you’re new to QlikView, start with this Discussion Board and get up-to-speed quickly.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
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
MVP
MVP

1 day back

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

or without date (bold)

View solution in original post

3 Replies
Partner
Partner

This blog can be helpful:

Relative Calendar Fields

MVP
MVP

1 day back

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

or without date (bold)

View solution in original post

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!