Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Gvmpro
Partner - Contributor III
Partner - Contributor III

How To: use Final Stock calculation as Initial Stock in Load Script

Hi all,

Im new in QS and i need to create an inventory with an initial stock from 201801 onwards .The problem is that i need to calculate te final stock for that period and use it as the iniStock for the rest. I cant do it in the app directly because i would have to insert every prev-period calculation in the new final stock and that as you already know, is completelly unefficient.

After all calculations, the table with my  final inventory looks like this:

INV_CFS_KU_Temp:
LOAD
YEARMONTH_Stock_Initial,
[BLEND],
[IniStock.ActQt] as IniSotck_Blend_KU,
CompraKG_Blend,
InterStockKU_Blend,
Consumo_Blend,
InterStockKU_Blend - Consumo_Blend as FinalStockBlend
Resident InventarioCFS_KU ;
Drop Table [InventarioCFS_KU];

I have the results i need for the firt period, but the problem, i should not be taking the IniStock for each period but the final form the prev period.

Sorry if im not explain very well, hopefully somebody have an idea to do this.

Thx. 

 

Labels (2)
1 Solution

Accepted Solutions
sunny_talwar

I think what you really need is Peek/Previous

View solution in original post

1 Reply
sunny_talwar

I think what you really need is Peek/Previous