Hi All,
I have a customer dataset with the dates. Each customer ordered multiple times. I want to create an end date based on the next order date.
For the last order of a customer, his end date will be the same as the order date.
If custome have only one order then his end date will be the same as the order date.
Here is the example.
Customer_id date
111 02JAN2021
111 05JAN2021
111 10JAN2021
222 08JAN2021
333 12MAR2021
333 18MAR2021
The output will be
Customer_id date end_date
111 02JAN2021 05JAN2021
111 05JAN2021 10JAN2021
111 10JAN2021 10JAN2021
222 08JAN2021 08JAN2021
333 12MAR2021 18MAR2021
333 18MAR2021 18MAR2021
"Thank you"