Hello,
I would like dynamically find the field name which has the latest years in it and change it's name as per screenshot below. What is the easiest way to achieve this?
Many thanks
@inguli three ways of achieving this has been addedmark done if solved.
Use a Field Info tool (Developer ribbon) to get the field names.
Sort field names.
Create a new field to hold the one new name, with a Formula tool.
Use Dynamic Rename tool.
If you post your data in a table or as an attachment you'll likely get example workflows.
Chris
@inguli use dynamic rename toolif contains([_CurrentField_],right(tostring(datetimeyear(DateTimeToday())),2)) then "Amount" else [_CurrentField_] endifworkflow attached for referencemark done if solved.
Sorry, I'm quite a newbie with Alteryx and Alteryx community.
Many thanks @ChrisTX and @Raj for the provided solutions and for suggestion about posting data in a table or as an attachment.
@Raj solution nearly works but because my actual data had 2024-25 field in it, it renamed the 2024-25 field to Amount and 2023-24 field to Amount2.
Is it possible to adjust the formula so it changes the field name on the highest year?