Dynamic Rename of Constantly Changing Field Name
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I have a workflow where a field name changes from one month to the next (i.e. Prior Month = "Assets as of 7/1/23", Current Month = "Assets as of 8/1/23"). I want the workflow to convert the field name to always equal "Assets". Attached is a workflow to show what the input file looks like for a given month. It would also be helpful if the replacement field name is positioned in the same location as the original field name.
Because my Alteryx skill level is intermediate, I'm looking for a non-macro solution 😁.
Solved! Go to Solution.
- Labels:
- Data Investigation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Use the Dynamic Rename tool, Rename Mode = Formula, Formula =
IF
StartsWith([_CurrentField_],"Assets as of ") THEN "Assets"
ELSE [_CurrentField_]
ENDIF
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@MarieanneG If your input is an Excel file, you can configure it to push your field names down one line by selecting the check box next to "First Row Contains Data." Then you can use a Dynamic Input tool to change all the field names to the value in the first row of data, except for F4, which is where you'll have your field name that constantly changes. After that, you can use a Select tool to change "F4" to "Assets."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
One side effect of using the option "First Row Contains Data".... all fields will be imported as data type V_String or V_WString
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
The first solution didn't work since the field name was missing from the dynamic rename tool after I ran the workflow with a different as of date. The 2nd solution solved for this. Thank you both!
