Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

How to select specific columns

Learner09
8 - Asteroid

Hello All,

 

In my Alteryx workflow, I have an excel spreadsheet (Input Data) that contains approx. 26k lines/ rows with 350 columns but I need some specific columns for my analysis - around 100 columns out of 350 in a specific order. Is there any way I can pull only100 columns that I need in a specific order, or do I need to arrange and select manually? Please guide.

 

Thanks,

11 REPLIES 11
AngelosPachis
16 - Nebula

Hi @Learner09 ,

 

Is there any pattern in the column headers? So for example, if all your columns are named F1,F2,F3,...., F349, F350, then there is a pattern and you can use a dynamic select tool to keep only the columns you need (that's my first suggestion)

 

Another way to go would be to transpose everything so you will get the column headers in a single column and the values in a second column, and then you can filter as necessary on the field names. The you would have to cross-tab back, and to get the correct order you can assign a number prefix in the header of each column, so 1_ would be for your first column, 2_ for the second and so on.

 

Then you can remove those prefixes with a dynamic rename tool.

 

Hope that helps.

 

Angelos

Learner09
8 - Asteroid

@AngelosPachis thanks for the suggestion, The second option looks good. I have attached the sample data, Is that possible for you to draw a flow? In the attached data yellow highlighted columns I need and I also added the desired column sequence.

 

Thanks,

AngelosPachis
16 - Nebula

There you go @Learner09 

AngelosPachis_2-1612868883959.png

 

 

 

As I couldn't identify any patter in the column headers, I went for the second method I suggested in my earlier message and I suggest you two ways to go about it.

 

The first one is quite tedious as you have to go inside that formula tool and assign all columns to a sequence ID.

 

The second way should be faster for you, so you can use a lookup table. In this extra input tool, you can type all columns you want to keep in the sequence you want them ordered, and the workflow will create the desired output.

 

Hope that helps, let me know if that worked for you or you have any questions on the workflow.

 

Cheers,

 

Angelos

Learner09
8 - Asteroid

@AngelosPachis Thank you so much for the flow but it partially works or fulfills my requirement. It not picking all columns that I need, and this flow also not picking the column that I added in my flow-through formulae. Also, I have 300 columns and I wanted all in my flow because in the future if I needed then I will just tick select and incorporated them in my flow. I am looking for something that will give me the option to pick 100 columns that I need out of 300 columns.

AngelosPachis
16 - Nebula

Hi @Learner09 ,

 

The workflow I sent over keeps the 7 columns you wanted out of the 14 total given in the provided dataset above, so I don't see how this is not working for your workflow.

 

Did you try typing down in the text input tool (lookup table) all the columns that you need and the workflow does not work? I can't understand what the issue is so maybe you could give another example of the problem?

Learner09
8 - Asteroid

Hi @AngelosPachis please see the attached file. Hope this will help you to understand what I am looking for.

AngelosPachis
16 - Nebula

Hi @Learner09 ,

 

I had a look on the attached file and here is a workflow that will give you what you are looking for.

 

AngelosPachis_0-1612889196972.png

 

Correct me if I am wrong and please let me know if something is not right.

 

Cheers,

 

Angelos

 

Learner09
8 - Asteroid

Hello, @AngelosPachis Thanks for all your effort and Patience.

Let me explain it in another way - The real scenario is -  I am working on an Alteryx Model in which I have an Input file that contains around 400 columns and 30k Rows data. In the flow, I have further added some new columns as per analysis requirements (I have added 18 new columns through formulae and other tools). At the end of the flow, I have a total of 418 columns and I just need only 118 columns in my output (100 out of the 400 that is from the input file and 18 my new added columns) that too in specific sequences. I just wanted these 118 columns appearing on the top 1-118 in the select tool and the rest 300 columns following these 118. I wanted all columns in the select tool because in the future if I need any of these, so I will able to use them, but as per current requirements, I wanted 118 columns in my output.

 

Thanks,

Mayank

Learner09
8 - Asteroid

@AngelosPachis Some more details

Labels