Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi all,
i have a table production with the following columns:
COMPLETION_DATE,
QTY,
STATUS,
ORG_CODE,
ITEM_NO,
ITEM_TYPE
im trying to create a master calendar on the COMPLETION_DATE but keep getting a 'Field 'a' not found error'.
QuartersMap:
MAPPING LOAD
rowno() as Month,
'Q' & Ceil (rowno()/3) as Quarter
AUTOGENERATE (12);
Temp:
Load
min(COMPLETION_DATE) as minDate,
max(COMPLETION_DATE) as maxDate
Resident production;
Let varMinDate = Num(Peek('minDate', 0, 'Temp'));
Let varMaxDate = Num(Peek('maxDate', 0, 'Temp'));
DROP Table Temp;
TempCalendar:
LOAD
$(varMinDate) + IterNo()-1 As Num,
Date($(varMinDate) + IterNo() - 1) as TempDate
AutoGenerate 1 While $(varMinDate) + IterNo() -1 <= $(varMaxDate);
MasterCalendar1:
Load
TempDate AS COMPLETION_DATE,
week(TempDate) As P_Week,
Year(TempDate) As P_Year,
Month(TempDate) As P_Month,
Day(TempDate) As P_Day,
YeartoDate(TempDate)*-1 as P_CurYTDFlag,
YeartoDate(TempDate,-1)*-1 as P_LastYTDFlag,
inyear(TempDate, Monthstart($(varMaxDate)),-1) as P_RC12,
date(monthstart(TempDate), 'MMM-YY') as P_MonthYear,
ApplyMap('QuartersMap', month(TempDate), Null()) as P_Quarter,
Week(weekstart(TempDate)) & '-' & WeekYear(TempDate) as P_WeekYear,
WeekDay(TempDate) as P_WeekDay
Resident TempCalendar
Order By TempDate ASC;
Drop Table TempCalendar;
can anyone see what im doing wrong?
TIA
I have 2 other master calendars in my data model aswell, think these have something to do with the issue? it seems to not like my TempCalendar, but this is the exact same as my other 2 tempCalendars, so not sure what the issue is 😕
Can you send a screen shot of the error message
Is there somewhere in the script you are trying to load a field 'a' ?
Have you tried using debug mode ?