I have a table with year, customerID and productID and I want to create a column named flag (preferably in the load script). I would also be satisfied with creating 3 columns (lost,renew,new), but I don't know exactly how to do this with values from the same table.
renew= customerID&productID exist in 2013 and also in 2012.
lost = customerID&productID exist in 2012 but not in 2013
new = customerID&productID exist in 2013 but not in 2012
How can I compare the values? My guess would be to use one of the functions: exists, lookup or peek.