Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Don't forget to submit your entry for the Excellence Awards by October 30! | Need more information about the program? Check out the blog here

Select Columns and Concatenate them based on user input

Highlighted
5 - Atom

Hello all

 

I have a workflow which uses a few columns concatenated and the data is then summarized over it. Right now, it is done manually. i select a bunch of columns which i want concatenated, then i use a Formula tool to append them and create a new column. then i do a bunch of operations like Join, Unique, so on and so forth.

 

Here is an example shown in Excel - In this i have chosen Column 1, 3 and 5 and concatenated them to "Index"

 

data example2.jpg

 

What i am aiming for now, is to create a User Interface for this. Here what it would do -

1) first ask the user what excel file to load

2) after choosing the file, the columns in the file are shown as a list 

3) the user will select 4 or 5 column names which they want to concatenate

4) the workflow with take the selections, concatenate the columns and do the rest of the workflow.

 

Can anyone here please help me with this ? What are the tools to use for this ? 

Highlighted
Alteryx
Alteryx

My initial thought is to leverage a chained analytic app. The first one runs and uses a transpose to get all of the column names which can then be chosen from in a subsequent analytic app for the combination. The fields that are chosen would populate a filter on the transposed data to isolate the columns that are desired. Then you could use a summarize tool to concatenate the value column with whatever separator is desired and grouping by potentially a record ID if you establish that earlier.

Highlighted
12 - Quasar

@BrandonB I've been a little MIA on the community with the tax busy season kicking in! Always like seeing you help others, I bookmark so many topics with your responses. 

 

The Chained Application idea is awesome. I've used that in the past. 

 

I've referenced these links on the community:

 

https://community.alteryx.com/t5/Interactive-Lessons/Chaining-Analytic-Apps/ta-p/243120

 

https://community.alteryx.com/t5/Alteryx-Designer/Configure-a-Workflow-to-use-a-Tree-Interface-Tool/...

 

Specifically, the tree tool can really help you accomplish what you are looking to do here, IMHO.

 

TTYS,

 

J

Highlighted
Alteryx
Alteryx

Thank you for the kind words @the_jake_tool! I'm happy to hear that some of my contributions have been helpful. 

 

@miguel_garci12 

I mocked up the second part of the workflow that does the actual field isolation and concatenation. The only piece that will need adapted is the filter tool. This workflow would function as the second part of the analytic app that dynamically updates the filter with the relevant field names. Hopefully this gets you started! Happy to help if you get stuck on the next part. I attached the workflow to this post so you should be able to download it and use it as a starting point. 

 

concat.png

Highlighted
Alteryx
Alteryx

If you had a static file it would be a lot easier because you could just set it up like this and feed it into a list box. However, because you want them to specify the file AND the columns, it needs to be a two step process. 

 

snip 1.png

Highlighted
5 - Atom

Thank you the_jake_tool for the video. it was very informative. I believe i need to make 2 analytics apps and run them one after another to get the solution i want. this is good, thanks.

 

Thank you BrandonB for the workflow solution. If i understand correctly, i need to make two workflows right ? 

workflow 1 - this one will give the user an option to browse to a file of their liking and save it temporarily somewhere as a yxdb file

workflow 2 - this one will take the saved file and then input the file info to 3 places viz. A,B,C - 

A - Record ID tool

B - List box (this is where the user will select the column names he wants to concatenate on)

C - the Select Tool

 

now the second part (2) i can understand. The workflow you have sent is perfect. for a given file input, i can choose the columns i want to concatenate over and then i get the new column added at the end. this is great.

 

The first part (1) is where i am having a challenge. I want to select a file using a user interface so this should be a separate analytics app which will be run first. the file browse allows me to select a file but i am not able to save this file or pass it to the next analytics app. I want the file browse tool to send the file i select, to a yxdb output, so that i can take this saved yxdb file forward for the second analytics app.

 

Am i missing something here ? Can you please help me with this ?

 

Labels