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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
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
theboss-123
Creator II
Creator II
Author

Hi Again Edwin 

i extracted the result to excel and the calcule are logical but it not looks like the  Systeme outcome

when u have time please try to take a look here 

theboss123_0-1657015512421.png

 

 

theboss123_1-1657015535237.png

 

 

theboss-123
Creator II
Creator II
Author

after modification in excel the resuts must look like this

 

theboss123_2-1657016095624.png

 

my selection is 

theboss123_3-1657016166218.png

 

edwin
Master II
Master II

you dont appear to understand that adding a new dimension requires changes to your expression.  ive already shown you the solution, you just need to tweak it if you add new dimensions.  pls try it on your own 

theboss-123
Creator II
Creator II
Author

So i tried to update your expression 1 as below : 

rangesum(above(Sum({<
IPTDAT_0={">=$(vMinDate)<=$(vMaxDate)"},
ID_Transaction={"1","3","5","13","28","31","16","19", "2","4","6","17","27"}
>}[Qantité]),
1,rowno()))
+

if(isnull(aggr( nodistinct Sum( total <Dim3,Dim1>{<
IPTDAT_0={"<$(vMinDate)"},
ID_Transaction={"1","3","5","13","28","31","16","19", "2","4","6","17","27"}
>}[Qantité]), Dim3,Dim1)),0,
aggr( nodistinct Sum( total <Dim3,Dim1>{<
IPTDAT_0={"<$(vMinDate)"},
ID_Transaction={"1","3","5","13","28","31","16","19", "2","4","6","17","27"}
>}[Qantité]), Dim3, Dim1))

 

and 

 

=if(
IPTDAT_0>=date('$(vMinDate)')
and IPTDAT_0<=date('$(vMaxDate)')
and (aggr( sum( {<ID_Transaction={'1','3','5','13','28','31','16','19'}>}[Qantité]),IPTDAT_0, Dim1)>0 or
aggr( sum( {<ID_Transaction={'2','4','6','17','27'}>}[Qantité]), IPTDAT_0, Dim1)<0
)
,
IPTDAT_0
)

 

but i got same result 

below the ultimate desired result

theboss123_0-1657028226346.png