Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Accumulation on date

HI all,

kindly help me to solve.

i have a scenario .I have to find parts creation date based on the stock condition.

I have below sample data.

The opening count -here shows the count of parts on a opening of a  day
buying quantity-purchased qty on a particular day
selling quantity -sales of a  part on a particular day

i need to find parts creation date based on the stock.

For example,the parts creation date for first row is the same as the date in the Column1.

Then the calculation of parts creation date follows as below;

we need to look up for the cumulative count of the 'selling quantity' against the opening count.

100>10   =1-jan-14
100>10+50=1-jan-14
100>10+50+20=1-jan-14
100>10+50+20+20=1-jan-14
100>10+50+20+20+25  condition is false as 100>125 so it should check for the next parts creation date.

here the difference is 25 .it checks the first row of buying quantity which is 5 .
i.e 5>25 -false
then 5+10 >25 -false
then 5+10+10>25 -false
then 5+10+10+10>25 -true,so the corresponding date is taken as the next part creation date.here 4-jan-2014

Then if the buying quantity is null or zero,the parts creation date should be the previous date on which buying quantity has values.
here 5-jan-2014.

Then the next part creation date will be the date where buying quantity has values.

DATEopening countbuying quantityselling quantityClosing countParts creation datecumulative
1-Jan-14100510951-Jan-1410
2-Jan-14951050551-Jan-1460
3-Jan-14551020451-Jan-1480
4-Jan-14451020351-Jan-14100
5-Jan-14351025204-Jan-14125
6-Jan-1430020105-Jan-14145
7-Jan-141001005-Jan-14155
8-Jan-1400005-Jan-14
9-Jan-1400005-Jan-14
10-Jan-1400005-Jan-14
11-Jan-14030201011-Jan-14
12-Jan-141015101511-Jan-14
13-Jan-141520152013-Jan-14
0 Replies