Syntax seems to be ok for me. But I may change
as I'm not sure about comparing a datefield with date format (as you are getting in your load script) stored in Monthend field with the numeric value returned by the preceding "#" in your set analysis.
By the way, I would suggest you to change the name of the field MonthEnd, as this is, as well, the name of a function, which can mislead QlikView when operating (set analysis or whatever) try to distinguish beyween function name and field name. This may be likely affecting your set analysis.