Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Number Days Between two dates on columns

Fescobar
8 - Asteroid

Hello Community,

 

I am looking to get and place the number of days on specific columns.

 

$ 13 WE 03/28/20$ 13 WE 06/27/20$ 13 WE 09/26/20$ 13 WE 12/26/20$ 4 w/e 01/25/20

 

For example on the second column I'd like to have the number of days between date on the first column.  On the the third column the number of days between the date on the second column...so on and so forth.

 

This is the formula I have added...I was pretty certain that it wasn't going to work as expected.

 

 

 

Any help on this will be AWESOMELY appreciated.

 

5 REPLIES 5
Emil_Kos
17 - Castor
17 - Castor

Hi @Fescobar,


I am not sure how to use your output but most basic way to calculate difference between two days would be using this formula:

 

DateTimeDiff([column1],[column2],'day')

AngelosPachis
16 - Nebula

Hi @Fescobar ,

 

Not sure when you want to put that date difference in that field, but I have placed that date difference at the end of each field.

 

AngelosPachis_0-1611165457851.png

 

So F1 has no date difference because it's the first one in that category of dates, but the F2 field comes 91 days later. The same goed for fields F3 and F4. 

 

For F5, whatever comes at the front changes, so this is considered as a separate group, so nothing comes at the end, but F6 comes 28 days after F5 and so on.

 

Hope that makes sense, let me know if you have any questions on the workflow.

 

Cheers,

 

Angelos

Fescobar
8 - Asteroid

.@angelospachis

 

This is pretty awesome and from your explanation, it looks like a winner.  I have additional columns on my spreadsheet that I didn't think were relevant; however, when I attach it and run the formula...they obviously are and I was totally wrong. 

 

The dates are the only ones I need to count the day in between.

 

I am attaching a sample of the entire dataset that I am working with.

 

Thank you once again for lending a hand on this effort.

AngelosPachis
16 - Nebula

Hi @Fescobar ,

 

Yes, a couple tweaks needed indeed to make this workflow work. Essentially the extra step was to add a record ID and the filter to split your data in to two streams, the one containing the column headers (which you have to edit) and the other the actual data.

 

AngelosPachis_0-1611168924154.png

 

 

At the end of the column header processing, you bring the stream back together with a union tool and then use a dynamic rename tool to make the first row of data the column headers.

 

Hope that makes sense, please reach out if you have any questions on the workflow.

 

Regards,

 

Angelos

Fescobar
8 - Asteroid

This is awesome!!  Thank you!!

Labels
Top Solution Authors