# Duration next line

**URL:** <https://community.easymorph.com/t/duration-next-line/1135>\
**Category:** General Q&A\
**Created:** [June 18, 2019, 11:29pm UTC](https://community.easymorph.com/t/duration-next-line/1135 "2019-06-18T23:29:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rykie](https://community.easymorph.com/user_avatar/community.easymorph.com/rykie/32/1255_2.png) [@Rykie](https://community.easymorph.com/u/Rykie)\
**Post date:** [June 18, 2019, 11:29pm UTC](https://community.easymorph.com/t/duration-next-line/1135/1 "2019-06-18T23:29:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Rykie](https://community.easymorph.com/user_avatar/community.easymorph.com/rykie/32/1255_2.png) [@Rykie](https://community.easymorph.com/u/Rykie)\
**Post date:** [June 19, 2019, 3:36am UTC](https://community.easymorph.com/t/duration-next-line/1135/2 "2019-06-19T03:36:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dgudkov](https://community.easymorph.com/user_avatar/community.easymorph.com/dgudkov/32/5_2.png) [@dgudkov](https://community.easymorph.com/u/dgudkov)\
**Post date:** [June 19, 2019, 6:02pm UTC](https://community.easymorph.com/t/duration-next-line/1135/3 "2019-06-19T18:02:52Z")

</div>

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](https://community.easymorph.com/uploads/default/original/1X/6a4f060bd8fb186e2a8110edd885f0d381f79896.morph) (4.4 KB)

 ![image](https://community.easymorph.com/uploads/default/original/1X/d9b7ceeea34816d7b8646eed6a42b00ec3733dc6.png)
