Qlik Community

Ask a Question

New to Qlik Sense

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

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
helge_jorg
Creator
Creator

Set analysis – select value three days before today’s date

 Gents,

I would like to select yesterday, the day before yesterday and so on in a set analysis. When I use this expression, it gives me the sum of yesterday and the day before, insted of the value of that day. 

sum({<[COVI19World.confirmed],  Dato={">$(=Date(Today()-3))"}>}   [COVI19World.confirmed])

 

Expression.JPG

 

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar

Date format was an issue... try this

Sum({<[COVI19World.confirmed], Dato = {"$(=Date(Today()-3, 'YYYY-MM-DD'))"}>} [COVI19World.confirmed])

 

View solution in original post

7 Replies
sunny_talwar

For one day, try this

Sum({<[COVI19World.confirmed],  Dato = {"$(=Date(Today()-3))"}>}   [COVI19World.confirmed])

or

Sum({<[COVI19World.confirmed],  Dato = {"$(=Date(Today()-2))"}>}   [COVI19World.confirmed])
helge_jorg
Creator
Creator
Author

Thanks for your suggestion, Sunny.

Your expression gives a value of 0, so it does not work correctly. I did try with different days (-1,-2.-3)

 

sunny_talwar

This is working and showing a non zero number

Sum({<[COVI19World.confirmed], Dato = {">$(=Date(Today()-3))"}>} [COVI19World.confirmed])

But this isn't?

Sum({<[COVI19World.confirmed], Dato = {"$(=Date(Today()-3))"}>} [COVI19World.confirmed])

 

helge_jorg
Creator
Creator
Author

 

 

Expression_.JPG

 

sunny_talwar

Is Dato a date field or is it a timestamp field, which includes date and time component?

helge_jorg
Creator
Creator
Author

I think it is a date-filed, at least the data only contains date, and not time. In my master calendar it might be a timestamp, but I’m not sure. 

I have attached a sample-app.

Thanks for helping me!

sunny_talwar

Date format was an issue... try this

Sum({<[COVI19World.confirmed], Dato = {"$(=Date(Today()-3, 'YYYY-MM-DD'))"}>} [COVI19World.confirmed])

 

View solution in original post