Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Select columns based on a list

datamonkey
8 - Asteroid

Hi,

 

I am trying to figure out how to select columns based on whether they appear in a list (which I have built elsewhere in my macro). This will be dynamic as part of a macro that reads in multiple Excel files and outputs selected columns to a DB table.

 

Is this possible? Dynamic Select doesn't have multiple inputs so I don't see how I can use that; I can't see the right way to combine my two inputs together to get the output I need.

 

So I have input tool (Excel source) and input tool (a list of columns) plus some data processing steps, and I need to get to an Output tool to a database where the output is the Excel file but only the columns I need.

 

Thanks in advance for any assistance.

3 REPLIES 3
atcodedog05
22 - Nova
22 - Nova

Hi @datamonkey 

 

Here is what you can do. Taking reference from one of @PhilipMannering solution.

 

Workflow:

atcodedog05_0-1629981806894.png

 

1. Using formula adding a column meta info to the list of columns and setting value as keep.

2. Using dynamic rename and changing the list of columns metainfo to keep in the data.

3. Using dynamic select tool keep only column with metainfo keep.

 

Hope this helps : ) 

datamonkey
8 - Asteroid

Thanks @atcodedog05 - I thought I'd be lucky if I got an answer by Monday! That works perfectly 🙂

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @datamonkey 

Cheers and have a nice day!

Labels