Free Trial

Alteryx Designer Desktop Discussions

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

Splitting columns into 6 columns

Inactive User
Not applicable

 

Hi all,

 

I have 3 columns(creationDate, startDate and endDate ), i want to split these columns into a day, month, year, hours, minutes, seconds. for each column.

 

The output is :

 

creationDate-daycreationDate-monthcreationDate-yearcreationDate-hourscreationDate-minutescreationDate-secondsstartDate-daystartDate-monthstartDate-yearstartDate-hoursstartDate-minutesstartDateseconds
0610201916323306102019163200

 

How i can do it? 

 

thanks

 

 

4 REPLIES 4
estherb47
15 - Aurora
15 - Aurora

Hi @Inactive User !

You can try the DateTimeFormat function on each column. I'd use a multifield formula tool, to convert all 3 columns at once into the respective pieces

e.g., for the month, DateTimeFormat([_CurrentField_],"%m")

Each piece has a code to use for the information you want to pull out.

 

Let me know if that helps!

 

Cheers,

Esther

estherb47
15 - Aurora
15 - Aurora

And here's a link to the help page with the definition of the format codes:

 

https://help.alteryx.com/current/designer/functions/datetime-functions

 

Cheers!

Esther

T_Willins
14 - Magnetar
14 - Magnetar

It also can be done in a Formula tool using DateTimeYear(dt), DateTimeMonth(dt), etc.

MichalM
Alteryx Alumni (Retired)

@Inactive User 

 

Using the Formula tool and the DateTimeFormat function is one option

 

dtformat.png

 

You can also use the TextToColumns tool and split on colon, hyphen and a space

 

t2c.png

Labels
Top Solution Authors