5 Replies Latest reply: Mar 10, 2016 6:37 PM by Stefan Wühl RSS

    Calculate number of days how long inventory lasts?

    Petteri Paananen

      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:

       

      DateInventory BalanceDemand Forecast
      2016-01-01400200
      2016-01-02600400
      2016-01-03700300
      2016-01-04200
      2016-01-05100
      2016-01-0680
      2016-01-07400
      2016-01-08200

       

      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