I am looking to update/extend column Process such that it reflects whether or not the Process has ended.
For example, table below should return:
Id Process
1 Completed
1 Completed
1 Completed //Id 1: because the last Process state was End
2 InProgress
2 InProgress //Id 2: because the last Process state was not End
3 InProgress
3 InProgress
3 InProgress
3 InProgress //Id 3: because the last Process state was not End
Table:
datatable(Id:int, Process:string, UpdateTime: datetime))
[
1, "Initiate", datetime(2020-02-02 12:00:00),
1, "Start", datetime(2020-02-02 13:00:00),
1, "End", datetime(2020-02-02 14:00:00),
2, "Initiate", datetime(2020-02-02 12:00:00),
2, "Start", datetime(2020-02-02 13:00:00),
3 "Initiate", datetime(2020-02-02 12:00:00),
3, "Start", datetime(2020-02-02 13:00:00),
3, "End", datetime(2020-02-02 14:00:00),
3, "Reopen", datetime(2020-02-02 15:00:00),
]