Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Deselect/remove column

aparna0208
8 - Asteroid

Hi,

 

I'm trying to unselect/remove a column based on a condition. I have an email column where it could all be Empty or have values. If that column is empty it should be deselected. I tried this using dynamic select but for some reason I keep getting this error "unknown variable". Just wondering if I'm doing anything wrong or is there a better way to do this? Thank you in advance!

 

aparna0208_0-1671054391199.png

 

14 REPLIES 14
martinding
13 - Pulsar

Hi @aparna0208 

It is because the Email field needs to be wrapped around by brackets. [Email]

 

aparna0208
8 - Asteroid

@martinding Thank you for the response. I already tried that and it didn't work.

martinding
13 - Pulsar

Sorry, I misread the screenshot.

 

One simple way to "deselect" a field that contains all empty values is to use the data cleanse tool, and remove the selected null column (you can convert to null from empty first if necessary).

 

Please see the attached workflow.

binuacs
21 - Polaris

@aparna0208 have you tried the data cleansing tool - the remove null columns option selected

 

 

Felipe_Ribeir0
16 - Nebula

Hi @aparna0208 

 

The only way of doing this with the dynamic select tool that i know is by passing the columns that you want to select to a dynamic select tool that is inside a macro. But the easiest way is using the data cleansing tool.

 

You can find a example of how to do it using both methods on the attached file.

Felipe_Ribeir0_0-1671055850703.png

 

aparna0208
8 - Asteroid

@martinding @Felipe_Ribeir0 @binuacs Ah I don't know how did I forget this simple data cleansing tool that did the magic. Thank you so much for all your inputs and reminding me about this tool:) It worked:)

aparna0208
8 - Asteroid

Having said this I need help with one last thing. Now that I'm using data cleansing tool to remove the email field if it's all null and keep it if it has values. I have one more step where I have to see if that email column exists in the output then need to apply a filter to remove all personal emails. Is there a way to do this to see if that column exists in the output and if so apply this logic if not ignore? @martinding @Felipe_Ribeir0 @binuacs 

Felipe_Ribeir0
16 - Nebula

Hi @aparna0208 

 

I believe that you can filter out the fields that contain "@gmail.com", "@yahoo.com" etc

or filter in the fields that contain "@company1.com", "@company2.com". I would take the second way.

 

Before of the data cleansing tool, ofc.

Felipe_Ribeir0_0-1671057573311.png

 

PanPP
Alteryx Alumni (Retired)

Hi @aparna0208 

 

You can use a filter or a formula tool depending on what you are trying to do.

 

In the filter tool, you can filter by contains @gmail.com, @mail.com etc

In the formula tool, you can do If Contains([ColumnName], "@gmal.com") then "Remove" else "Keep" endif... etc

 

Something like this would help you accomplish that.

 

Hope this helps.

Labels