Alteryx Designer Desktop Discussions

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

Dynamically Drop Columns

apatel1501
8 - Asteroid

i need to drop certain columns dynamically and i've been trying to use dynamic select as an option to do this.  

 

Dynamic Select.png

 

 

I want to drop all columns that end in "P06".  However, sometimes it will be P05 or P04 or anything based on the number of years of data I have.  Data is attached. Any suggestions appreciated.

 

Thanks!

3 REPLIES 3
apatel1501
8 - Asteroid

Nvm - solved this by transposing, parsing out the column names, finding the max period using a summarize tool, and joining back to filter out the max period.

sparksun
11 - Bolide

You can use Select Via a Formula option in Dynamic Select, then use the following expression:

REGEX_Match([Name], ".*[12345]$") or [Name]="CustomerName"

 

If you want to drop all columns that end in "P05”,just change the expression to:

REGEX_Match([Name], ".*[12346]$") or [Name]="CustomerName"

OTrieger
13 - Pulsar

@apatel1501 
You still can use Dynamic Select tool, as long as you can define what is needed to be removed you will be able to do it with Dynamic Select. By using the Dynamic Rename Tool you can Update fields Description, last option. Use Field Info tool and then based on your logic filter all the headers that are not needed. Create a new fields named Description and set it with Need,  Keep or any other word. Connect your data to Dynamic Renaming tool and than update fields Description, add a Dynamic Select tool and then select Formula. Set a Formula Description=Keep or any word that you used and you will be left only with the needed headers.

Labels
Top Solution Authors