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

Finding the max date that is a string

fitch1892
7 - Meteor

Im trying to find the max date of each record. Ive tried using the summarize tool, but its not producing the max date of each record. What can I do? 

 

ID | date (V_string)

1   | 06/01/2012

1   | 12/03/2011

 

When I use the max function in summarize tool i get --> 12/03/2011 and i want to get 06/01/2012

 

5 REPLIES 5
JamesCharnley
13 - Pulsar

Hi @fitch1892,

 

Do you have a specific reason this needs to be a string and not a date? I'd expect it would even be easier to turn it into a date, find the maximum and turn it back into a string than hard code some string calculation. It's returning 12/03/2011 at the moment simply because 1 is bigger than 0.

Felipe_Ribeir0
16 - Nebula

Hi @fitch1892 

 

For this to work, you must convert your date(string) to a date format:

 

Felipe_Ribeir0_0-1673277176423.png

 

fitch1892
7 - Meteor

When I do that, some of my records turn out NULL() when they shouldn't be.

Felipe_Ribeir0
16 - Nebula

@fitch1892 

 

Try one time with the above and one time with the bellow formula:

 

datetimeparse([date], '%d/%m/%Y')

datetimeparse([date], '%m/%d/%Y')

 

Felipe_Ribeir0_0-1673278028289.png

 

If you still getting errors after that, could you please share how the null cell data looks like before the formula?

fitch1892
7 - Meteor

Thank you. I decided to use 'DateTime' tool and it worked for me.

Labels