6 Replies Latest reply: Oct 5, 2011 3:56 PM by Jonathan Dienst RSS

    Previous price by article

      Hello community,

       

      I'm trying to find out the price differences by articles from our sales table.

      The fields uses are

       

      orderid

      orderdate

      articleid

      price

      amount


      I need to show the difference concerning the price from the "current" order  to the previous order. If an article is sold more often also only the last order vs. last order -1 is relevant. Has someone a hint for my how to implement this in loading script?

       

      Thanks in advance

       

      Aloah

        • Previous price by article

          hi,

           

          you can create a new tablebox  (ordrid, aticleid, price). go to properties and sort descending ordid. make sure to make a selection on the last articlid somewhere on the sheet. you should see if there is a difference in the 2 first listed prices

          • Previous price by article
            Deepak Vadithala

            Hi Aloah,

             

            Is the "orderdate" field in your table a DateTime or just Date? Also, can you post some sample data and I can work an example for you.

             

            Cheers - DV

              • Previous price by article

                Hi DV,

                 

                orderdate is datetime.

                 

                Data looks like

                 

                orderid     orderdate                         articleid   price     amount

                1             01.09.2011 00:00:00         a1              10             2

                1             02.09.2011 00:00:00         a2              10             3

                1             03.09.2011 00:00:00         a3              10             19

                1             06.09.2011 00:00:00         a1              12             6

                1             06.09.2011 00:00:00         a3              10             8

                1             07.09.2011 00:00:00         a1              13             4

                1             08.09.2011 00:00:00         a6              10             55

                 

                 

                I'm trying to show within the chart that article a1 was bought last time with price 13 last previous order was with price 12. the order on 1.9.2011 with price of 10 isn't relevant. Only the current and the prev order are relevant.

                eg.

                 

                last order with price 13 (+1) or something like that.

                 

                Thanks

                 

                Kind Regards


                Aloah