I am new to the Alteryx. I have a requirement where i have to change the Column header name dynamically. I have attached a file that contains all information. 'Technical Field Label' is a actual field name, and 'Field Info - Usage by Country code and Field label used by country' is the field that contains the new column headers. Row no. 5 to 25 contains the country code and Header name that needs to be replaced, based on the country code the column header name assign the Column header name.
Process:
- Read the input file name '1209_XXX_EC Delta_POL_May_08_25_2020' where 'POL' is the country code.
- Read the file name like this and based on the country code from the file name rename the field header from the excel file.
Solved! Go to Solution.
Are you able to upload an example of what you're looking for with the output?
I'm thinking you can do something like this to parse out each country code, the field names for each country, and the associated technical field name. You'd have to create a list for the fields that apply to all countries as well. From there, you can filter for the country the file is for, and then use a dynamic rename to use the "old" and "new" field names.
Hope this helps!
I have attached an input file '1209_XXX_EC Delta_POL_May_08_25_2020' that contains the original column header.
Another file contains the Countrywise field sets. Take '1209_XXX_EC Delta_POL_May_08_25_2020' as main input file. Read the file name and look for the country code in the file name. Now take that country code and go to 'Countrywise_Record' reference file. Now original fields (from '1209_XXX_EC Delta_POL_May_08_25_2020' needs to be renamed with the new field name from 'Country_Record').
There is a 'Final_Output' file attached which contains the renamed record for 'Country Code' = POL.
If the field name from the Input file ''1209_XXX_EC Delta_POL_May_08_25_2020' ' matches with the reference file 'Countrywise_Record' then rename it as per 'Countrywise_Record' else return the original field name from the input file '1209_XXX_EC Delta_POL_May_08_25_2020'. Need to compare it for each country code.
The attached solution achieves what you're looking for using the original file you provided. Essentially, the top section creates a list of your field names and corresponding country field name. The bottom section parses the file name to find the proper country code to use. The dynamic rename at the end renames the columns accordingly.
HOWEVER, your reference list of field names needs to match exactly. You'll notice it is not renaming the fields as expected because they are different. For example, the field is called "Address 1" in your file and "address1" in your reference file. These need to match exactly for this to work. Please update your reference file.