Hello Everyone,
I really looking forward for your help and support, in Qlik Script side
Future QOH Formula for Calculation - (Current Month Inventory QOH (Jan-2024) + Production Units (Feb-2024) ) - Demand Units (Feb-2024)
![vinayak_rastogi_terex_0-1705896585086.png vinayak_rastogi_terex_0-1705896585086.png](https://community.qlik.com/t5/image/serverpage/image-id/127481i75E4BF0B2D95361E/image-size/medium?v=v2&px=400)
Likewise same for other months future months, Based calculated Future QOH for next Month March 2024
I've try that in Qlik Script -
T2:
Load
%Key,
Date(CalMonth, 'MMM-YYYY') as CalMonthDate,
Prod,
Geo,
model,
Mfg_location,
SUM(quantity_on_hand) as SUMQty,
SUM(Demand_Units) as Demand_UT,
SUM(Production_Units) as Production_UT
Resident Table1
Group by %Key, Geo, Prod, model, Mfg_location, CalMonth
Order By model, Geo, Prod, Mfg_location, CalMonth asc;
NoConcatenate
FutureQOHTemp:
Load
RowNo() as ID,
%Key,
CalMonthDate,
Prod,
Geo,
model,
Mfg_location,
SUMQty,
Demand_UT,
Production_UT,
IF(model <> Previous(model) ,SUMQty,(Peek(StockNew)+Production_UT)-Demand_UT) as StockNew
Resident T2
Order By Geo, Prod, model, Mfg_location, CalMonthDate asc;
Output based on above script - Red Circle Output showcasing wrongly, other side showcasing the output for "King County" is correct (Highlighted in Yellow)
![vinayak_rastogi_terex_0-1705898685251.png vinayak_rastogi_terex_0-1705898685251.png](https://community.qlik.com/t5/image/serverpage/image-id/127482iAFB41F3EAAE54618/image-size/medium?v=v2&px=400)
Thank you!