Is there a way to create a field that adds columns with with a target string in the field name? For the example below, add columns with "Sales_" in the header? Currently, I use a formula tool with the expression, [Sales_Jan]+[Sales_Feb]+[Sales_Mar], but this gets cumbersome as more months' sales gets added into the data. Thanks.
Region | Sales_Jan | Sales_Feb | Sales_Mar | Sales Total |
W | 10 | 12 | 8 | 30 |
E | 14 | 10 | 10 | 34 |
George
Solved! Go to Solution.
The attached workflow should do the trick. I use the Cross Tab tool to create Name - Value pairs and then filter the rows that just contain Sales in the Name. The values are then summed and the total columns are rejoined to the original input on the record ID that was added using the record ID tool.
You should look at the options in the dynamic rename tool which is built specifically for this sort of thing - https://community.alteryx.com/t5/Alteryx-Knowledge-Base/Tool-Mastery-Dynamic-Rename/ta-p/32920
Are you sure? I'm confused as to how you could use the dynamic rename tool to sum columns
My mistake - misread the question (which I thought was about the column labels).
Great, this works. Thanks for the help.