Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

How to handle date inputs

jpscoralick
8 - Asteroid

Hello everyone! I've been unsuccessfully trying to handle some of my date inputs.


My input is a .xlsx file where some of the date columns are read as String type on one day, and as Date type on other days.
And the string/date formats can vary between these ones:
YYYY-mm-dd
YYYY-mm-dd HH:MM:SS
dd/mm/YYYY
and so on...

 

Would be nice to convert all the dates to a single format, like dd/mm/YYYY (portuguese/brazilian format), for example.
Does anyone know how to handle date entries for all the formats i need?

 

Thanks in advance!

5 REPLIES 5
Watermark
12 - Quasar
12 - Quasar

Can you share a 1 column spreadsheet of your dates?  I have an idea, but like to see 'all' the formats you may deal with.  I'd also consider that you don't change to the dd/mm/YYYY format and that you go with ISO yyyy-mm-dd format that is native alteryx. 

Watermark
12 - Quasar
12 - Quasar

If you only have a couple this get you there, but conceptually you can also expand. 

Different Dates.jpg

jpscoralick
8 - Asteroid

Sure, @Watermark!

Here are some samples of inputs that I have.

The main problem is that sometimes the date is read as a String, and on others as Date.

Thank you!

 

jpscoralick_1-1659551208589.png

 

 

Watermark
12 - Quasar
12 - Quasar

Jpscoralick, 

 

So remove that variable. If you take the file I attached before, then you can just tell it in the first select statement to treat the column like a string field which you'll want for how the flow handles it anyhow to ultimately resolve around a functional date field. See my attachment in the prior post and let me know if that gets you where you need. 

jpscoralick
8 - Asteroid

@Watermarkthanks a lot!
by just inserting a Select tool and setting the date column as String, up to now all by datasets are being read as strings, so I'm being able to handle them like you suggested on the flow you've attached.

Labels