I'm having a little bit of trouble with my master calendar script. I've reused this script in many of my applications without any trouble. Today I was developing a new application and it threw a script error after I inserted the master calendar code. A picture of the error is attached and my code is below. I don't understand why Qlik thinks there is a field in this part of the script. Has anyone ran into something similar to this? Thanks in advance!
temp_date: Load min(DocDate) as start_date, Max(DocDate) as end_date Resident Transformation1;
Let vstart_date=peek('start_date',0,temp_date); Let vEnd_date=peek('end_date',0,temp_date);
MasterCalendar: Load DocDate, num(Month(DocDate)) as DocMonth, Month(DocDate) AS Doc_Month, MonthName(DocDate) as Doc_Month_LM, If(Month(DocDate) > 0 and Month(DocDate) < 4, 'FY-'&(Year(DocDate)-1)&'-'&Right(Year(DocDate),2),'FY-'&Year(DocDate)&'-'&Right((Year(DocDate)+1),2)) as DocYear_Filter, If(Month(DocDate) > 0 and Month(DocDate) < 4, Year(DocDate)) as DocYear
Beside the already mentioned missing single-quotes around the tablename you should check if this table is generated because if there is an identically table before your load creates no new table else the data will be appended to the previous table (a solution might be a noconcatenate statement). Further check if your DocDate is really a date and not a timestamp or a string.
A quite helpful check if the variables contain the expected values is using trace, like:
Sometimes QlikView load the field names including some extra spaces or special characters . please make sure to load the script properly and debug the code to find out the peace of code where we got the actual error.