Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
mdmukramali
Specialist III
Specialist III

calculate the Order Year Sequence

Dear All,

below is the sample data

LOAD * Inline

[

CUSTOMERID ,  YEAR

1 , 2006

1 , 2007

2 , 2007

2 , 2012

3 , 2007

4 , 2007

5 , 2007

7 , 2005

7 , 2007

7 , 2008

7 , 2011

7 , 2013

9 , 2003

9 , 2007

9 , 2012

10 , 2007

10 , 2011

10 , 2012

11 , 2007

18 , 2006

18 , 2007

18 , 2009

18 , 2012

18 , 2013

18 , 2015

18 , 2004

18  , 2003

]

;

looking for the Output like below.

CUSTOMER DETAILS.PNG

each customer can make only one order per year.

CUSTOMERID = 1 make two order in 2007 and 2006.

so i need the last Sequence (YEAR)  in the first column and next Year of Order year in the next column so on.

attached the sample file also.

Thanks,

Mukram.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Maybe like attached?

View solution in original post

2 Replies
swuehl
MVP
MVP

Maybe like attached?

mdmukramali
Specialist III
Specialist III
Author

Thanks Stephen,

Perfect Solution.

Thanks,

Mukram