My use case is analysing ticket in order to attribute a state regarding all the status of a specific ticket.
Raw data look like this :
Id | Version | Status | Event Time |
---|---|---|---|
0001 | 1 | New | 2021-01-07T09:14:00Z |
0001 | 1 | Completed - Action Performed | 2021-01-07T09:38:00Z |
Data looks like this after transaction command:
Id | Version | Status | Event Time | state |
---|---|---|---|---|
0001, 0001 | 1, 1 | New, Completed - Action Performed | 2021-01-07T09:14:00Z, 2021-01-07T09:38:00Z | Acknowlegdement, Work |
I'm using transcation command in order to calculate the duration of acknnowlegdement and resolution of the ticket.
I have predefine rule to choose the correct state. This rules compare the n-1 status (New), and the current status (Completed - Action Performed) to choose the state.
Issue
Each ticket has a different number of status. We can not know in advance the max status number. I can not write a static search comparing each value of the Status field.
Expected Solution
I have a field that inform me the number of index on the status (number of status of a ticket) field.
I want to use a loop (Why not a loop for), to iterate on each index of the field Status and compare the value i-1 and i.
I can not find how to do this. Is this possible ?
Thank you