Days Difference Between Dates Vertical

Hi Easymorph community,

I am hoping someone has dealt with something similar in the past.

I have a scenario where I am trying to get the delta in number of days between two records that share the same id. It is a transaction table so is vertical. I know EM mostly handles calculations at the record level (i.e horizontally in my mind).

The catch is that a single id could have a variable number of date changes. In this particular data set, the date represents the dat a customer is requesting delivery. They push this date in and out. It could happen any number of times or not at all.

DateDiff.xlsx (5.8 KB)

Any assistance in a clean method for me to solve this would be awesome!

You can use the “Shift column” action to bring ID and date from previous row. Previous date is needed to calculate the difference. Previous ID is needed to check if we’re comparing dates for the same ID.

See the project below.

vertical-date-diff.morph (4.4 KB)

Thank you Dmitry!!!

You’re welcome :slight_smile: