About EasyMorph Tutorials & Examples Web-help

Duration next line


#1

Hi Dmitry

I would like to know how to get the next line to merge to previous line to work out the duration between 2 Statuses.

Example
|ID|LogTime|Status|
|328|10/01/19|1|
|328|10/01/19|2|
|328|10/01/19|3|
|328|28/01/19|4|
|328|28/01/19|5|
|328|30/01/19|6|
|328|21/02/19|7|

to this
|ID|LogTime|Status|End|Duration|
|328|10/01/19|1|10/01/19|0|
|328|10/01/19|2|10/01/19|0|
|328|10/01/19|3|28/01/19|18|
|328|28/01/19|4|28/01/19|0|
|328|28/01/19|5|30/01/19|2|
|328|30/01/19|6|21/02/19|22|

Thanks

Rykie


#2

Hi Dmitry

I solved the problem.
Used Enumerate to add row
Then row-1
Then merge it on ID and Row = Row-1 and brought LogTime across.

Regards

Rykie


#3

You can also use the “Shift columns” action – it’s intended for bringing a previous value into the same row.

See below your question solved using the “Shift columns” action:
duration.morph (4.4 KB)