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

Announcements
Now accepting applications for the Qlik Luminary and Partner Ambassador Programs: Apply by July 6!
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

Labels (1)
1 Solution

Accepted Solutions
Miguel_Angel_Baeyens
Employee
Employee

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
Employee
Employee

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!