Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask 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