Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Community,
I'm trying to work out the previous Max Order Date (by customer).
I would like to obtain 2 informations:
1) the last Customer Order Date >>>>> OK [expression: Max (ORDER_DATE) or aggr(max(ORDER_DATE),Customer)]
2)the previous last Customer Order Date >>>>>> PROBLEMS
---------------------------------------------------------------------------------------------------------------------------------------------------------
This is my GOAL:
Customer | Max(ORDER_DATE) | PREVIOUS max(ORDER_DATE) |
Tom | 11/04/2014 | 08/04/2014 |
Mark | 15/04/2014 | 13/01/2014 |
This is my original table:
ORIGINAL TABLE | ||
Customer | ORDER_DATE | Order_Quantity |
tom | 06/04/2014 | |
tom | 07/04/2014 | |
tom | 08/04/2014 | 5 |
tom | 09/04/2014 | |
tom | 10/04/2014 | |
tom | 11/04/2014 | 4 |
tom | 12/04/2014 | |
tom | 13/04/2014 | |
tom | 14/04/2014 | |
tom | 15/04/2014 | |
tom | 16/04/2014 | |
Mark | 06/04/2014 | |
Mark | 07/04/2014 | 2 |
Mark | 08/04/2014 | |
Mark | 09/04/2014 | |
Mark | 10/04/2014 | |
Mark | 11/04/2014 | 3 |
Mark | 12/04/2014 | |
Mark | 13/04/2014 | 3 |
Mark | 14/04/2014 | |
Mark | 15/04/2014 | 4 |
Mark | 16/04/2014 |
Thanks
Markus
Max(ORDER_DATE,2)
or
Aggr(Max(ORDER_DATE,2),Customer)
check the attached app...
Great Guys!!!
Thanks all, i really appreciate...
Have a nice day