Alteryx Designer Desktop Discussions

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

How to auto exclude fields if they are not part of core group?

hellyars
13 - Pulsar

 

I have multiple files I want to bring into a workflow using a macro.  The "core" fields are common across each dataset, BUT each data set may have 0-n extra fields that I do not need.  These extra fields may have different field names from year-to-year.  The "core" field names do not change from year-to-year.   In my simple iterative or batch macro, I can use a Select tool to uncheck the unwanted fields, but this can't account for different unwanted fields in the other files and these will be included in the output.    I am familiar with https://community.alteryx.com/t5/Weekly-Challenge/Challenge-72-Compare-Data-Sets-Fields-Columns/td-p... 

 

Is there a way to auto exclude fields if they do not appear in the "core" group/list?

 

File 1

KEEP_1KEEP_2NOT NEEDEDKEEP_3
    

File 2

KEEP_1KEEP_2KEEP_3
   

File 3

NOT NEEDEDKEEP_1NOT NEEDEDKEEP_2KEEP_3
     
2 REPLIES 2
echuong1
Alteryx Alumni (Retired)

Have a Select tool right before the end of your macro. In the Select tool, uncheck the "Unknown" field at the bottom. This will automatically uncheck any field that is not in the originally checked list.

 

echuong1_0-1603810750569.png

 

 

If your field names also have a common word in them, you can use a dynamic select tool. For example, only keep fields with the word "keep."

TheOC
15 - Aurora
15 - Aurora

hi @hellyars 

It sounds like you are very close already!

With the select tool, just deselect the bottom option of unknown - dynamic or Unknown Fields

TheOC_0-1603810805116.png

 



This should get rid of all the ones you have not selected!



Bulien
Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels