Alteryx Designer Desktop Discussions

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

Macro for changing date format of multiple columns at once

Megshipp
6 - Meteoroid

Hello all- 

 

I am relatively new to Alteryx, so I am kind of just messing around with it at the moment. I am trying to see if there is a way to create a macro that would change the date format of multiple date columns at once (specifically to MM/dd/yyyy).

 

We have quite a few date related fields that we can pull from such as Invoice date, delivery date, paid date, and more. And we won't necessarily use each one in every work flow. So, I was hoping there was a way to create a macro that would let me select the fields I want to change the format of and then do it all at once while still leaving the rest of the columns in the output. 

 

Is that doable? and if so, is a macro even the best way to do that? I'd love to be able to create something that my whole team could easily put into their workflows. 

 

 

 

 

 

4 REPLIES 4
usmanbashir
11 - Bolide

@Megshipp  - I think you can begin with using the Multi-Field Formula tool. You can write a formula with some functions like DateTimeParse() or DateTimeFormat(). If you can provide a data sample, I'd be happy show you specifically for your use case!

Megshipp
6 - Meteoroid

I was able to create one that would change the date formats, but all the inputs had to also be in my workflow for it to work. And we just don't need to have all those in every workflow. So I was hoping for something more... generic? I was using formulas to change the dates though. Attached is my current workflow. 

usmanbashir
11 - Bolide

@Megshipp - please see attached workflow. I configured the Multi-Field formula tool to select all DateTime fields (dynamic/unknown fields too). As long as the incoming fields going into the Multi-Formula tool are all date fields, it will dynamically pick them up and format as %m/%d/%Y.   You don't need to create separate formula for each field if you use this method. Hope this helps! Let me know if you need anymore help/clarification.

Megshipp
6 - Meteoroid

Yep- That did it. I was making it more difficult than it needed to be. Thank you for your help!

 

Labels