6 Replies Latest reply: Nov 10, 2016 11:40 AM by Luiz DePaula RSS

    Previous day Stock on Hand - script

    Luiz DePaula

      Hello experts,


      I am having a challenge where I need to calculate the difference between the stock on hand from any day versus the stock on hand from previous day. So, another measure called "Previous Day Stock on Hand" has to be generated in the load script.


      I thought about using the Peek function, but I could not come up with the right syntax.


      I summary I would have


      Day          Stock on Hand          Previous Day Stock on Hand

      1                    300                                        -

      2                    450                                        300

      3                    400                                        450

      4                    550                                        400

      5                    350                                        550


      This is what I need. Can anyone help me?


      Thanks in advance.