In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Find the closest date out of 2 other columns

wonka1234
10 - Fireball

Hi,

 

Say I have [column1] with a date value of 2023-07-11 and

 

[column2] with a value of 2023-07-31 

 

and [column 3] with a value of 2023-08-30

 

how can I find the column closed to column 1 in a formula? the answer would be column 2 in this instance.

1 REPLY 1
FrederikE
13 - Pulsar

Hey @wonka1234,

 

IF
DateTimeDiff([Field1],[Field2],'days')
>
DateTimeDiff([Field1],[Field3],'days')
THEN "Field2"
ELSE "Field3"
ENDIF

Screenshot 2023-08-14 170253.png

Labels
Top Solution Authors