Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Month End Flag

Hey,

I'm looking to set up a flag for month:

Calendar:

LOAD Date,

IF(Date(Date,'DD/MM/YYYY') = MonthEnd(Date(Date,'DD/MM/YYYY')),1,0) as MonthEnd



From Table.

Why is this not assigning a '1' to the last Date of each month?

Driving me nuts!

Thanks

BR

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Hello,

Dates are interpreted as numeric values by QlikView. They are usually integers, but the MonthEnd() function returns the las hour, minute and second of that day, so you have to round the number to be interpreted as integer. The following should work:

IF(Date(Date,'DD/MM/YYYY') = Date(Floor(MonthEnd(Date)),'DD/MM/YYYY'),1,0)


Hope that helps.

View solution in original post

2 Replies
Miguel_Angel_Baeyens

Hello,

Dates are interpreted as numeric values by QlikView. They are usually integers, but the MonthEnd() function returns the las hour, minute and second of that day, so you have to round the number to be interpreted as integer. The following should work:

IF(Date(Date,'DD/MM/YYYY') = Date(Floor(MonthEnd(Date)),'DD/MM/YYYY'),1,0)


Hope that helps.

Not applicable
Author

Thanks,

Worked a treat!

Kudos!