Alteryx Designer Desktop Discussions

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

Designer Date Format in column

DanielCarro
8 - Asteroid

Hi,

 

I have an issue with a column which has different formats in the same column which I am struggling with, so I would appreciate any help on the community.

 

I am struggling to have these dates to be read in Alteryx, attached a sample. Cells (a2:a6) formatted as 'general'; cells (a7:a13) formatted as 'date', then in cell A13, the year appears as '89'

 

I need the dates to appear as dd-mm-yyyy

 

So I used the following:

Date1

DateTimeParse([Date],'%d-%m'-%Y')   - so I changing the string into date; then I do the following

DateTimeFormat([Date1],'%d-%m'-%Y') 

 

The above formula works well for the dates which are formatted in general but the other items appear as Null, so I am struggling on this one.

 

Regards,

Dan

3 REPLIES 3
PhilipMannering
16 - Nebula
16 - Nebula

Hey @DanielCarro 

 

How about using the following,

if REGEX_Match(Date, '\d{4}-\d{2}-\d{2}')
then DateTimeFormat(Date, '%d-%m-%Y')
else Date endif
DanielCarro
8 - Asteroid

@Philip thank you very much it did work

PhilipMannering
16 - Nebula
16 - Nebula

@DanielCarro That's great! Then could you mark this as solved please?

Labels