Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Max Date Same Field

Waller
5 - Atom

I have a file which has concatenated multiple dates into one field separated by a comma. Is there a way I can reference the max date within the field in a new column?

 

Waller_0-1615403467038.png

 

Thanks in advance

6 REPLIES 6
Luke_C
17 - Castor
17 - Castor

@Waller 

 

Here's one approach with some fake data, essentially use the text to columns tool to split out the concatenated dates into rows, and then summarize by max date. 

raychase
11 - Bolide

The following works if the dates (within a single record) are always in chronological order (ie. max date on the far right):

 

raychase_0-1615431816506.png

 

Otherwise, you can include a RecordID, clear spaces from the concatenations, text-to-rows on the comma delimiter, and finally, summarize by RecordID to get the MAX(Date):

 

raychase_2-1615432073580.png

 

 

Waller
5 - Atom

Thanks for the help. I've followed your flow below but it's coming back with mixed results - I think it might be because the date field is a string and it isn't able to distinguish the max/min date. I've tried to change the type to date but it didn't like it and brought back null values

 

Waller_1-1615486974511.png

 

 

Waller_0-1615486806119.png

 

Luke_C
17 - Castor
17 - Castor

Try the attached, I swapped the autofield for a date time parse based on your data. 

Waller
5 - Atom

Thanks! This has worked (I was trying to use existing column for Summarize output - new column brought back correct dates and format).

 

Thanks for the help

Cathy_L
7 - Meteor

Your post has the same use case as I do, except that my date format is different and I require minimum. I was encountering an error where the rows with 1 date seem to be going through as Date format, while the ones with multiple dates are String that when the DateTime tool is used, the ones with 1 date is not converted properly. Please see here: https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Min-Date-Same-Field-Comma-Sepa...

 

Wondering if anyone here could help please? Thank you!

Labels