Start Free Trial

Alteryx Designer Desktop Discussions

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

Rename second macro output field based on macro input

StefanW
6 - Meteoroid

Dear Alteryxians,

 

I want to use a macro to convert a string field containing date, time and time zone information into two fields: a date-time field containing UTC date-time information, and an integer field containing the time offset in hours. For example, I want to convert '2024-01-30 16:54:45.000 +0100' to '2024-01-30 16:54:45' and '1'.

 

I have managed to write the date and time information back into the original field, thereby changing its field type (i.e. 'Departure_Planned'). However, the field with the time offset is always written out with the field name used in the macro (i.e. 'offset'). Ideally, I would like to change this automatically using the input field name as a prefix (i.e. 'Departure_Planned_Offset'), but I can't figure out how to do this within the macro.

 

Can anyone help me on how to rename the second output field based on the input field name?

 

Thanks a lot,

Stefan

3 REPLIES 3
Dhrish
8 - Asteroid

@StefanW Here is the solution. I did some changes in the macro for optimising it as well. Hope this helps.

 

Thanks,

Dhrishya

StefanW
6 - Meteoroid

Thank you very much, Dhrishya, works perfectly!

Dhrish
8 - Asteroid

Great!

Labels
Top Solution Authors