Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Strange behavior of Date() & Today()

Hi,

Please see attached screenshot.  I have a variable called "vDataAsOf".  I have been observing this

through my screen for the past few days.  When I refreshed my document today, this variable had

"10/12/2016" as you can see in my debug screen.  It should have been 10/13/2016. 


This line of code doesn't always work 100%.  Can anyone tell me what's wrong with this code or maybe

there's a better function to always show System Date - 1?   Thanks

qv23.jpg

1 Solution

Accepted Solutions
sunny_talwar

Default timer_mode is set to 0 and 0 means day of last finished data load.

Capture.PNG

View solution in original post

5 Replies
sunny_talwar

Try this

LET vDataAsOf = Date(Today(1) - 1, 'MM-DD-YYYY');

Anonymous
Not applicable
Author

But what's wrong with what I had?  I want to understand this.  Thanks

Just as an fyi - it worked yesterday.

sunny_talwar

Default timer_mode is set to 0 and 0 means day of last finished data load.

Capture.PNG

Anonymous
Not applicable
Author

Sunny,

Thanks.  When I used today(1) as you suggested, it showed 10/13/16. I will keep watching this for the next few days.  I'm sure it's going to work since you (and others on this forum) have more experience than I.  These QV date

functions are definitely designed very much differently than other programming languages.  It's very natural for any

developers (including myself) to initially think Today() or Day() or GetDate() and subtract 1 from it to get yesterday's

day.  I didn't know there are actually parameters to which you can pass.

Thanks for the above link/info.