I have a dataset where I need to dynamically rename two columns based on their column position for changes made to reflect a new year. I am able to pull the field information and date into a stream where I use the Dynamic rename tool, but this isn't connected to the full dataset.
Thinking there should be an easier way to do this. Right now I am trying to transpose the columns to rows and then figure out a way to rename based on position this way. Below is a very simple visual of what I am needing to accomplish. Rename the name of the 4th column to a NewName.
Solved! Go to Solution.
Hi @ShankerV, thank you for your quick response! How could I do this is the name of "Column4" changes from year to year? I didn't explain that part well at all. So say, it starts as Column4 22, then the next year it is Column 423, but I need it to have the same name for both years. NewName.
So, it's the same file with the column name changing according to the year it is reporting in.
Hi @SDJ57
Using the contains function.
IF contains([_CurrentField_],"Column4")
THEN "NewName"
ELSE [_CurrentField_]
ENDIF
Input was:
Many thanks
Shanker V
Thanks again @ShankerV! The name changes from year to year. Is there a way to build in a formula to calculate current year and previous year as part of the contains? For example, contains("Column +"Previous Year") or contains("Column +"Next Year")?
Hi @SDJ57
Yes, sure we can give.
Can you please give me an example like Year will be in 2 digits or 4 digits like that.
Many thanks
Shanker V
Oh yes, for example: "Year 2022" and "Year 2023" changed to "NewYear" for both files.