Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Check out our powerful new search update! You can read more here. Please let us know if you have any feedback by creating a topic here.
SOLVED

How to add columns containing "x" in field name

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.

 

 

RegionSales_JanSales_FebSales_MarSales Total
W1012830
E14101034

 

George

Highlighted
Alteryx Certified Partner

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.

 

Capture.PNG

Highlighted
Alteryx Partner

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

 

Highlighted
Alteryx Certified Partner

Are you sure? I'm confused as to how you could use the dynamic rename tool to sum columns

Highlighted
Alteryx Partner

My mistake - misread the question (which I thought was about the column labels).  

Highlighted

Great, this works. Thanks for the help.

Labels