Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Qlik heads,
Thank you.
John
Maybe like this
INPUT: LOAD ID, Date#(Date,'MMM YYYY') as Date, Sale, Forecast, Final FROM (ooxml, embedded labels, table is Sheet1); LOAD *, If(previous(ID) <> ID and Sale>0, 1, If(previous(ID) <> ID, 0, Rangesum(Peek(SaleCount), If(Sale>0,1)))) as SaleCount RESIDENT INPUT ORDER BY ID, Date desc; DROP TABLE INPUT;
INPUT:
LOAD ID,
Date#(Date,'MMM YYYY') as Date,
Sale,
Forecast,
Final
FROM
(ooxml, embedded labels, table is Sheet1);
LOAD *,
If(previous(ID) <> ID and Sale>0, 1, If(previous(ID) <> ID, 0, Rangesum(Peek(SaleCount), If(Sale>0,1)))) as SaleCount
RESIDENT INPUT
ORDER BY ID, Date desc;
DROP TABLE INPUT;