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:
![RK121_0-1660854295070.png RK121_0-1660854295070.png](/t5/image/serverpage/image-id/87032iADB7920AD6948799/image-size/medium?v=v2&px=400)
![RK121_1-1660854947597.png RK121_1-1660854947597.png](https://community.qlik.com/t5/image/serverpage/image-id/87034i9D19F9CD77C75C29/image-size/medium?v=v2&px=400)