Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
where my code is
Temp:
Load
min([OrderDate]) as minDate,
max([OrderDate]) as maxDate
Resident [Orders];
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);
MasterCalendar:
Load
*,
If( DayNumberOfYear(OrderDate) <= DayNumberOfYear(Today()), 1, 0 ) as New_Date
;
Load
TempDate AS OrderDate,
week(TempDate) As Week,
Year(TempDate) As Year_Year,
Month(TempDate) As Month_Month,
Day(TempDate) As Day_Day
Resident TempCalendar
Order By TempDate ASC;
Drop Table TempCalendar;
Hi, it looks like the variables varMinDate and varMaxDate are not retrieving any value. You can check adding an "Exit Script;" before the "DROP Table Temp;" and check the values of the Temp table.
If this Temp table really has the expected values check the valus stored in the variable, and double-check if fields and variable names are written exactly the same, all in the same case.