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.
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?
Solved! Go to Solution.
I'm a bit confused by the ask - could you just have another Multi Field Formula tool after this one to do the DateTimeParse?
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.
@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?
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')
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
@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!