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: 
theboss-123
Creator II
Creator II

Calculation Stock Start and STock End

Hello , we have Database related to ERP which include all transaction of supply chain,i explain my problem by the table bellow

Date Start_Stock Income Outcome End_stock
01/01/2022 0 100 50 50
31/01/2022 50 200 100 150

 

in 01/01/2022 we 0 as start of stock there are income of 100 and utcome of 50 so end of stock is 50 in qlikview i success to got income and outcome

 

i want to creat a variable where we put values of Start Stock and put also End stock

Start stock must have the value of the previous End Stock i hope that it is clear can u help me please t developp my dahsboard in qlikview

Labels (1)
53 Replies
edwin
Master II
Master II

are you saying the table shown is the output table you want? 

and that you calculate Income, Outcome and End_Stock?  how about Start?
can you post sample data?  

here is a sample if start needs to be computed from 0:


edwin_0-1653491014227.png

 

dimension is Date, start (Column 1): 

=if(isnull(above(Column(4))),0,above(Column(4)))

column 4 (End):

=column(1)+Column(2)-Column(3)

 

theboss-123
Creator II
Creator II
Author

Hi that is right the shown table must look like the table on qlikview 

 

I can calculate income and outcome but for star of stock we need to declare a variable so after that we could calculate end of stock and when the date increase the start of stock must equal to end of stock of previous d?

theboss-123
Creator II
Creator II
Author

I will try your formula and going back to you soon 

edwin
Master II
Master II

just replace the 0 in the start expression:

 

=if(isnull(above(Column(4))),$(vStartVariable),above(Column(4)))

theboss-123
Creator II
Creator II
Author

Hi Edwin thanks for help regarding the variable "vstartvariable" does I must declared it before or I run the expression directly? 

theboss-123
Creator II
Creator II
Author

Hi again Edwin i tried you formula but it dosen't work on my real table

theboss123_0-1653518145439.png

 

Column(1)==if(isnull(above(Column(4))),$(vStartVariable),above(Column(4)))

Column(4)=Column(1)+Entréé-Sortie

 

theboss-123
Creator II
Creator II
Author

Hello is there any solution for our case ?

To make the idea a bit clear,the start stock of each article must be 0,because before integration of data to the ERP X3 the stock was 0 for each ITEM,so regarding the transaction of income and outcome the quantity change.

 

The start Date is 24/01/2015 .

edwin
Master II
Master II

you pls post sample data?

theboss-123
Creator II
Creator II
Author

Please Find enclosed the sample Data. i work avec QLIKVIEW DESKTOP V12.20