community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Dynamic concatenation of fields

Alteryx Partner

Hi,

 

 

I have an app that lets a user select a list of columns from the data, which will be shown as output.

 

Suppose there is 10 columns and user selects 3 (A,B,C) from them. Is it possible to create a formula which will concatenate the 3 fields as ABC?

In case someone selects A,B,C and D, the concatenation field should have ABCD values. All fields are strings.

 

In short-How can i create a concatenation field that will dynamically concatenate the user selected fields?

 

Thanks,

Bharath

ACE Emeritus
ACE Emeritus

I've created a simple macro that will do this inline; hopefully it should be straigthforward for you to pursue the same concept in your Analytic App. Basically, I have a List Box of checkboxes attached to the Macro Input, which generates a custom list of ToString([f1])+ToString([f2]) for whatever fields are checked.  My action then replaces the expression in a Formula Tool with exactly that custom list.

Hope that helps!

Highlighted

Try the following:

 

  • Add a record ID
  • Use a Transpose tool to rotate from columns to row based
  • You can then use a summarize to concatenate
  • Finally join back on record ID to get the result

 

Simple sample attached.

Alteryx Partner

Thank you guys for taking a shot at the challenge. JojnJPS

 

Alteryx Certified Partner

PERFECT!

Labels