The Alteryx Community is a finalist in three 2026 CMX Awards! Help us win Customer Support Community, Most Engaged Community, and User Group Program of the Year - vote now! (it only takes about 2 minutes) before January 9.
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Deselect/remove column

aparna0208
Cometa

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 RESPUESTAS 14
martinding
Púlsar

Hi @aparna0208 

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

 

aparna0208
Cometa

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

martinding
Púlsar

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.

binu_acs
Polaris

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

 

 

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
Cometa

@martinding @Felipe_Ribeir0 @binu_acs 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
Cometa

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 @binu_acs 

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.

Etiquetas
Autores con mayor cantidad de soluciones