4 Replies Latest reply: Sep 1, 2010 10:42 AM by ra117hama RSS

    How to calculate the change of a value (e.g. a price)?

      Following table is given:

      Seller | Product | Date | Price

      S1 | P1 | 2010-08-02 | 14.99

      S1 | P1 | 2010-08-03 | 17.49

      S1 | P1 | 2010-08-04 | 15.19

      S1 | P2 | 2010-08-02 | 5.69

      S1 | P2 | 2010-08-03 | 5.79

      S2 | P1 | 2010-08-02 | 13.99

      S2 | P1 | 2010-08-03 | 13.49

      ...

      A new column should show the changes of the price.

      Seller | Product | Date | Price | Change

      S1 | P1 | 2010-08-02 | 14.99 | -

      S1 | P1 | 2010-08-03 | 17.49 | 17%

      S1 | P1 | 2010-08-04 | 15.19 | -13%

      S1 | P2 | 2010-08-02 | 5.69 | -

      S1 | P2 | 2010-08-03 | 5.79 | 2%

      S2 | P1 | 2010-08-02 | 13.99 | -

      S2 | P1 | 2010-08-03 | 13.49 | 4%

      ...

      But how to define the formula? Maybe the inter-record-functions could help!?