2 Replies Latest reply on Oct 2, 2012 8:21 PM by mohen leo

    comparing values of two most recent entries

    mohen leo

      Hi!

       

      I have a table of items, the dates their prices were set/changed, and the prices that were set on those dates.

       

      For each item, I need to find the most recent price and when it was set, and the next-most recent previous price, and then calculate the change.

       

      I.e., data:

       

      ITEM         PRICE          PRICING DATE

      table          $20               1/10/12

      table         $25               2/15/12

      table         $22               4/10/12

      chair         $11               2/20/12

      chair          $13               3/10/12

      chair         $10               5/15/12

      chair         $15              5/20/12

       

      what I need:

       

      ITEM     CURRENT PRICE    PRICE CHANGE     DATE OF MOST RECENT PRICE CHANGE

      table      $22                         - $3                        4/10/12        

      chair     $15                        + $5                        5/20/12   

       

      Seems like a pretty straightforward thing, but I can't figure out how to access the price of the second-most recent price change date.

       

      Any advice?

       

      Thanks!