Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

Gather all 9 clues to complete the final Weekly Challenge on Dec 16!

Learn More

Dynamically Inserting Columns Based on Criteria


Use Case: Need to Insert a column titled "Ref." after every iteration of a field name that contains "QRE". The added "Ref." column bust be null, but the QRE values must be maintained.  


The number of QRE columns can change depending on different clients, So one client might only have 2 QRE columns and will only need two "ref" columns added. Another client might have 14 QRE columns and need 14 "Ref." columns added. There could be anywhere from 2-30 QRE columns so must be completely dynamic. 


The hardest part to our issue is unioning back in our data, and the union must keep the "Ref." column appended to its corresponding QRE column. 


Current Data Set:

Grouped By FieldsQRE1QRE2QRE3


What we need our data to look like: 

Grouped By FieldsQRE1Ref.QRE2Ref.QRE3Ref.
xyz1234 1234 1234 


What we don't want our data to look like when we try to union: 

Grouped By FieldsQRE1QRE2QRE3Ref. Ref. Ref. 


Please someone help with this issue. Its proven to be the hardest component of the entire workflow. 


I have this same issue. I had recently asked for a solution on the community but when my columns change dynamically my workflow breaks. If anyone knows the answer to this that would be awesome.


Running into a very similar issue actually. Was going to post but saw this post and came looking for help. If anyone has any advice that would be great!

Alteryx Certified Partner



Does this help?