10 Replies Latest reply: Jan 13, 2015 2:11 PM by David Cohen RSS

    How to calculate "Last Purchase Year" in transaction table load script (based on only prior data)

      Howdy,

       

      So here's my scenario,

       

      Standard transnational table.

       

      Load

      Order_Date,

      Order_Year,

      Customer#,

      Revenue

      From Excel;

       

      I want to calculate a new column for each record in this table that finds the last purchase year for each customer (only looking at previous years of data, less than & not equal to the current year)

       

      i.e. if we're looking at a customer's transaction in 2012, and their last purchase year (not including 2012) is 2010, that's the data i want to bring into the new column.

       

      Sample file attached,

       

      Much thanks!

       

      -David