Product Recency Categorization

ranjith
ranjith Registered Posts: 12 ✭✭✭✭

I have 3 columns -> USER_ID , PRODUCT_ID (BOTH NUMERIC) && ORDER_DATE

I want to generate a field that takes the difference b/w the max(ORDER_DATE) & 2nd max(ORDER_DATE) in DAYS for the same combination of USER_ID & PRODUCT_ID and stores the result in the new column.

A sample of the data below:

Any inputs on the same would be appreciated!

Best Answer

Answers

Setup Info
    Tags
      Help me…