Discussion board where members can get started with Qlik Sense.
I have the below data file. I have to find out the difference in the stock from the last reading of the previous date to the first reading of the next day.
So my resultant table should look something like:
I have tried using the peek function but couldn't combine it to the max,min(Time) of the day to get the difference
Go to Solution.
this script should do the trick
(ooxml, embedded labels, table is Sheet1);
if(Previous("Product Code")="Product Code" and "Date" <> Previous("Date"), Previous(Stock)-Stock) As StockDelta
Order By "Product Code","Date","Time";
drop Table DataTemp;
also attach is a demo app
Thanks Liron. This helped