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
Solved! Go to Solution.
@StefanW Here is the solution. I did some changes in the macro for optimising it as well. Hope this helps.
Thanks,
Dhrishya
Thank you very much, Dhrishya, works perfectly!
Great!
User | Count |
---|---|
52 | |
27 | |
25 | |
24 | |
21 |