Hi,
I have data in an excel file that has two columns named 2019 and 2018. As the test will be used over a number years the the headers will change to 2020 2019 and 2021 and 2020 respectively over time. Is there a way in which I can take the header with most recent year and rename it to Current Year and the later year to prior year?
Solved! Go to Solution.
There are a lot of ways to do this. One approach is a Dynamic Rename tool with the formula:
IF [_CurrentField_] = ToString(DateTimeYear(DateTimeToday()) )
THEN "Current Year"
ELSEIF [_CurrentField_] = ToString(DateTimeYear(DateTimeToday()) - 1)
THEN "Previous Year"
ELSE [_CurrentField_]
ENDIF
I've attached an example.
Thanks Tony! Works Great!!
User | Count |
---|---|
17 | |
15 | |
15 | |
8 | |
5 |