Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
shinnickr
Creator II
Creator II

Adding time to today() and using it in an if statement

Hello there,

I am trying to set a dynamic variable for dates comparing against reload time and current time.  My application will be reloading twice per day, once at 8 a.m. and once at 10 a.m..  Most of my data is refreshed at 8 a.m. but I have a "Yesterday" tab whose data refreshes at the 10 a.m. mark.  Currently I am using: =if( reloadtime() > today(), date(today() -1, 'YYYY-MM-DD'), date(today() -2, 'YYYY-MM-DD')) so that if someone accesses app before 8 a.m. it will actually be 2 days ago data and if someone visits after 8 a.m. it will be today's data.  So what I need to be able to do is say if the reloadtime is after 10 a.m., then use today()-1 so I get truly yesterday's data.

I would appreciate any and all help available and if I haven't described it well enough please feel free to ask some questions and I'll do my best to explain a bit more.

Thank you very much!

1 Solution

Accepted Solutions
sunny_talwar

May be this

=If(ReloadTime() > Today() + MakeTime(10), Date(Today() -1, 'YYYY-MM-DD'), Date(Today() -2, 'YYYY-MM-DD'))

View solution in original post

3 Replies
sunny_talwar

May be this

=If(ReloadTime() > Today() + MakeTime(10), Date(Today() -1, 'YYYY-MM-DD'), Date(Today() -2, 'YYYY-MM-DD'))

qlikview979
Specialist
Specialist

Hi Sunny Bro,

Can u help me on this?

Applymap or left join is not working for non matching values

Regards

Mahesh

shinnickr
Creator II
Creator II
Author

Sunny you rock!!!

Gosh, it's just that easy huh.  I thought it would be a lot more complicated than that.

Thanks a ton!!!