Alteryx Designer Desktop Discussions

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

Sorting/Removing dates to produce smallest DateTimeDiff

gbufalino
6 - Meteoroid

Hi, I am trying to get the smallest DayDiff between two dates, but I am having trouble with duplicates. Once the value that gives the lowest DayDiff has been used, it can't be used again. There cannot be date duplicates in either column (ER and Test). So, for each unique ER date, I need the corresponding unique Test Date that gives me the smallest DayDiff.

 

This is what my current output looks like, and I've bolded the values I want to keep:

 

Client NumberER dateTest DateDayDiff
111/6/202010/28/20209
16/18/20206/4/202014
13/29/20203/11/202018
111/15/202010/28/202018
18/17/20207/15/202033
112/2/202010/28/202035
18/17/20207/8/202040
112/9/202010/28/202042
111/6/20209/24/202043
111/15/20209/24/202052

 

Here's what it would look like if I had no duplicates and the correct pairing:

Client NumberER dateTest DateDayDiff
13/29/20203/11/202018
16/18/20206/4/202014
18/17/20207/15/202033
111/6/202010/28/20209
111/15/2020NULLNULL
112/2/2020NULLNULL
112/9/2020NULLNULL

 

The project focuses on clients who complete a Test before they go to the ER. 

Thanks for the help!

2 REPLIES 2
mot
11 - Bolide

Hi @gbufalino,

 

You can use Summarize twie to reach the intended conclusion:

Screen Shot 2021-02-24 at 11.53.55 AM.pngScreen Shot 2021-02-24 at 11.53.31 AM.png

Workflow attached. I hope this helps. Best.

gbufalino
6 - Meteoroid

Worked great. Thanks!

Labels