Alteryx Designer Desktop Discussions

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

Date Difference

Vapour02
8 - Asteroid

Hello all, I need help to find the date difference in days between two dates which are in same column.

Example:

Date: 

10/01/2022

10/09/2022

11/15/2022

11/25/2022

I tried the multi row formula but it gives the wrong output when the month changes.

Please help with the solution.

 

 

8 REPLIES 8
gawa
16 - Nebula
16 - Nebula

hi @Vapour02 

In order to use DateTIme functions properly, we need to be sure of the field type being Date type.

Here is the example to convert input data into Date type, and then calculate difference in days my Multi Row Formula tool.

image.png

Vapour02
8 - Asteroid

Also I forgot to mention there can me multiple account numbers for different dates so how to define that difference.

For example.

Account number.      Date

1234.                         10/01/2022

1234.                          10/10/2022

1245.                          10/05/2022

1245.                          10/08/2022

 

So I need to find the exact date difference for two dates for different accounts 

 

 

 

aatalai
14 - Magnetar

@Vapour02 

 

Are you looking for the difference with the row above?

 

 

 

Then should be DateTimeDiff([date], [ dater:row-1],'days')

 

If that doesn't work, check the date time format is correct, i.e that alteryx is reading the date as mm/dd/yyyy

 

Let me know how you get on

aatalai
14 - Magnetar

@Vapour02 in that case use the multi row tool and select group by account number

Vapour02
8 - Asteroid

Thank you so much that worked. The only mistake I was doing is not grouping by the account number. 

aatalai
14 - Magnetar

@Vapour02 glad to have helped :)

gawa
16 - Nebula
16 - Nebula

@Vapour02 

As @aatalai said, group by option can be used, and now updated WF looks  like this. Please do not forget to sort data by account & date to properly calculate the difference.

image.png

Vapour02
8 - Asteroid

@gawa thanks a lot this way worked as well. Much appreciated for all the help

Labels