Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Community,
In my Database i have Stock data only for 1st Day Like
Day Production Sales Stock
01 2 3 11
02 4 2
03 5 3
04 2 2
See i have Stock 11 for 1st Day and
Production is 2 that means Total Stock is 13 and sales is 3 so 13 - 3 = 10
Means My Closing Stock for 1st Day is 10. and 2nd day opening stock is 10 and so on......
I want to Displya like this.
Day Production Sales Stock
01 2 3 11
02 4 2 10
03 5 3 13
04 2 2 13
Thanks and Regards,
Villyee
Hello Villiyee,
I think this could be what you are looking for:
Stock_temp:
LOAD * INLINE [
Day, Production, Sales, Stock
01, 2, 3, 11
02, 4, 2,
03, 5, 3,
04, 2, 2,
];
Stock:
NoConcatenate
load
Day,
Production,
Sales,
if(len(trim(Stock))=0,peek(Stock)+peek(Production)-peek(Sales),Stock) as Stock
Resident Stock_temp order by Day;
drop Table Stock_temp;
exit Script;
Regards
Alberto Rodríguez.