Discussion board where members can get started with Qlik Sense.
I have a problem. I have a straight table and column names are
Month, ID, INPUT, OUTPUT, ONHAND
Onhand formula is : peek(Onhand,-1) + input - output.
As you see there is no 202007 value so 202008 onhand value is wrong.
It must be 2 then after 202008 value's must be according to formula . In other words if there is missing month previous month' onhand value must be taken then calculation must go on;
Write a if condition if prev month doesnt exist then use previous value of Onhand column else calculate it.
I wrote below if condition but does not work
if ( RowNo() = 1 , ONHAND, if (RowNo()>1 and ID= Peek('ID') and Month - Peek('Month ') > 31,peek(ONHAND,-1),if (RowNo()>1and ID = Peek('ID') and Month- Peek('Month') < 32, (peek(ONHAND,-1) + INPUT - OUTPUT) ))) as ONHAND_CAL_0
Kindly find the attached QVF.
Hope it helps.
Thanks & Regards