Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
greend21
Contributor II

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)

Tags (3)
1 Solution

Accepted Solutions
john_obrien
New Contributor III

Re: Today() Function

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
New Contributor III

Re: Today() Function

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