Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
I need to calculate the number of days how long the current inventory lasts if nothing comes in.
My fact table is the following:
Date | Inventory Balance | Demand Forecast |
---|---|---|
2016-01-01 | 400 | 200 |
2016-01-02 | 600 | 400 |
2016-01-03 | 700 | 300 |
2016-01-04 | 200 | |
2016-01-05 | 100 | |
2016-01-06 | 80 | |
2016-01-07 | 400 | |
2016-01-08 | 200 |
It should take the lastest value from Inventory Balance ( =700) and calculate how many days the Balance lasts with the forecasted demand.
The correct answer with the data above should be 3 (700-200-100-80)
I'd like to do this in the visualization side, not in scripting. The reason is that I might have a product dimension and to be able to see the value with a selection of products.
How to do this? The result should be displayed in a text box.
Thanks in advance,
Petteri
Sane way? Probably not...
I don't know of any sane way to do this without changing the load script. Perhaps Stefan knows a way.
Sane way? Probably not...
Thanks!
It worked!!
Cheers, Petteri
Damn it!!, I was so close, but had to jump on a call. I am glad I was moving in the right direction
Petteri,
glad that it works for your. I guess there are better way to solve your request, maybe with some small changes to the data model.
I guess the last inventory balance and the demand forecast is not changing with user selections per specific product?
So maybe it's possible to calculate your requested outcome already in the script, or at least part of the information used in my expression.
Best,
Stefan