Forum Discussion

ChristophEmrich's avatar
ChristophEmrich
Frequent Visitor
7 years ago
Solved

Daily Stock Volumes

Hi everybody!

 

Not sure if my problem can be solved. I've been messing around with in for hours now and I can't seem to find a solution.

 

I have two tables:

[Table1] has all dates from 1/1/2017 until 12/31/2018:

Selected Date
1/1/2017
1/2/2017
1/3/2017
1/4/2017
...
12/31/2018

[Table2] is a product list with two dates: incoming and outgoing date.

Product	Incoming Date	Outgoing Date
A	2/12/2017	2/18/2017
B	2/13/2017	2/28/2017
C	2/13/2017	2/19/2017
D	3/17/2017	3/20/2017
E	3/20/2017	3/28/2017
F	3/27/2017	4/10/2017

I'd like to have a measure which calculates the sum of products being in stock each day.

 

For example: From the 13-Feb-2017 until 18-Feb-2017 we had three products in stock: A, B and C. So on the chart I'd like to see a "3" for each day from 13-Feb-2017 until 18-Feb-2017. I'd like to see "2" for 19-Feb-2017 because product A went out the day before. And so on. Like this:

 

12-Feb-17	1 (A)
13-Feb-17	3 (A, B, C)
14-Feb-17	3 (A, B, C)
15-Feb-17	3 (A, B, C)
16-Feb-17	3 (A, B, C)
17-Feb-17	3 (A, B, C)
18-Feb-17	3 (A, B, C)
19-Feb-17	2 (B, C)
20-Feb-17	1 (B)

I don't care which products are in stock, I'd just like to see the sum of products. Is this possible? Thank you!