Forum Discussion

rajesh_mangipud's avatar
rajesh_mangipud
New Contributor II
2 years ago

Get order of records within a group

I have a situation something like this:

 

Employee ID

Effective Date

Office

1

1/1/2023

San Francisco

1

1/1/2024

Oakland

2

6/1/2023

Sydney

2

12/1/2023

Tokyo

 

 

I need to add an order column and end date of the previous record column. Can you please suggest any ways of doing this? The output should probably look like this:

Employee IDEffective DateOfficeEnd DateOrder
11/1/2023San Francisco12/31/20231
11/1/2024Oakland 2
26/1/2023Sydney11/30/20231
212/1/2023Tokyo 2

 

Best,

Rajesh