Hi,
please check the following dataset
customerid purchasedate
1 5/9/2013
1 5/20/2013
1 5/29/2013
2 6/8/2013
I need to calculate resultset like
"customerid" "recency (max date - min date i.e. #days)" "deviation from last purchase date in dataset"
1 20 (5/29/2013 - 5/9/2013) 30 (6/8/2013 - 5/9/2013)
I can't use max (date) here as it will always give me for the grouping column & not teh abslute max date. is there a way to achieve this ?
Tags:
Forums: