Hello! I have autogenerated new date field UPDATE_DT_TEST to show the forecast for the next 4 month, but this only works for the full dataset. As soon as I filter any field(like State, City etc.), the future data for linear regression disappears. Does anyone know what can be done in the table settings or maybe script?
I also have a master calendar, but the auto-generated date has to be created separately since we use the master calendar for other tabs (UPDATED_DT exist only if sales present for that state/city)
Script tab:
Let vMaxDate = Num(Date#('12-01-2022','MM-DD-YYYY'));
Let vMinDate = Num(Date#('05-01-2022','MM-DD-YYYY'));
Temp:
LOAD $(vMinDate) + IterNo() as Temp_DT
AutoGenerate 1
While
$(vMinDate) + IterNo() <= $(vMaxDate);
Temp2:
LOAD
If(Temp_DT <= Today(), Date(Temp_DT,'MM/DD/YYYY'), Null()) as UPDATE_DT,
Date(MonthStart(Temp_DT),'MM-YYYY') as UPDATE_DT_TEST
//Date(Temp_DT,'MM/DD/YYYY') as Temp_DT_Date
RESIDENT Temp;
Example: