Cast your vote for the official 2025 Inspire Pin! Designs were submitted by fellow Community members and reflect the creativity and passion of Alteryx users across the globe. Vote now!
Free Trial

Alteryx Designer Desktop Discussions

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

Multi-Formula tool - how to datetimeparse certain fields

wonka1234
10 - Fireball

Hi,

 

How can I apply this to many fields?

 

The issue is that I already have a multi formula tool and dont want to override my initial one.

wonka1234_0-1680202142194.png

 

I want to do 

DateTimeParse([CERTAINFIELDS],'%d-%b-%y')

 

 

all my fields are strings.

 

Is it possible to date time parse certains fields without ruining my first multi formula tool?

 

5 REPLIES 5
alexnajm
18 - Pollux
18 - Pollux

I'm a bit confused by the ask - could you just have another Multi Field Formula tool after this one to do the DateTimeParse?

Yoshiro_Fujimori
15 - Aurora
15 - Aurora

Hi @wonka1234 ,

If you have a different set of columns to process with Multi-Field Formula tool, and you want to specify each of fields, @alexnajm 's approach would be the best.

If you want to convert all the fields which are formatted in '%d-%b-%y', you may want to add ELSEIF in your clause.

For example:

IF IsEmpty([_CurrentField_]) THEN Null()
ELSEIF REGEX_Match([_CurrentField_], "\d{1,2}-[a-zA-Z]{3,4}-\d{4}")
THEN DateTimeParse([_CurrentField_],'%d-%b-%y')
ELSE [_CurrentField_]
ENDIF

Good luck.

wonka1234
10 - Fireball

@alexnajm  perhaps I am confused. When I run two of them consectively, will it overwrite the first one? 

 

Ie I want the first tool, convert empty to null, 2nd tool (on the same  fields) , use date timeparse.

 

Will the 2nd tool overwrite the first tool results?

OllieClarke
15 - Aurora
15 - Aurora

@wonka1234 

 

If you convert the data type to a date, then empty strings will be converted to nulls, so you just need a single multi-field formula tool of:

DateTimeParse([_currentfield_],'%d-%b-%y')

OllieClarke_0-1680270960710.png

 

To answer your other question, alteryx runs tools sequentially, so if you had multiple multi-field formula tools in a row, alteryx would perform the function of the first, then take its output and perform the function of the second etc. etc. 

 

Hope that helps,

 

Ollie

 

alexnajm
18 - Pollux
18 - Pollux

@wonka1234 yes it'll overwrite your fields if that's the logic implemented, but it's not going to revert back to making your values empty as @OllieClarke mentioned!

Labels
Top Solution Authors