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

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
greend21
Creator III
Creator III

Today() Function

Since today is 2/27 I would expect the below statement to return 1 but it returns 0. Does anyone know why?

=IF(date(TODAY()) = DATE(MONTHEND(TODAY())-1),1,0)

1 Solution

Accepted Solutions
john_obrien
Contributor III
Contributor III

Dan,

It looks like the time of day or fractional part of the date value is making them different.  This should give you the result you want:

=IF(date(TODAY()) = Floor(DATE(MONTHEND(TODAY())-1)),1,0)

The Floor() function returns the integer part of the date value.

Hope that helps.

View solution in original post

1 Reply
john_obrien
Contributor III
Contributor III

Dan,

It looks like the time of day or fractional part of the date value is making them different.  This should give you the result you want:

=IF(date(TODAY()) = Floor(DATE(MONTHEND(TODAY())-1)),1,0)

The Floor() function returns the integer part of the date value.

Hope that helps.