Alteryx Designer Desktop Discussions

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

Dynamically Select Fields based on how many null records they have

aklassen3
5 - Atom

I am aggregating multiple datasets from different sources using the union tool. The number of extraneous fields in the datasets may change over time, so I want to dynamically select which fields to include when aggregating based on the percentage of records in that field are null. Any ideas on how to tackle this?

 

Field_NameCountBlank_ValueCountNonBlank_ValuePCT_BLANKKEEP_FIELD?
ACTUAL_SKU_PRICE5371431880.373630197Y
BUDGET_CENTER_CODE/DEPARTMENT_11227222100385.38667594N
BUDGET_CENTER_CODE/DEPARTMENT_21227222100385.38667594N
BUDGET_CENTER_CODE/_DEPARTMENT_11248321889386.85475735N
BUDGET_CENTER_CODE/_DEPARTMENT_2634068031944.11619412N
CHILD_ACCOUNT01437250Y
COMPANY_ID487379498833.90989737N
COMPANY_NAME01437250Y
CONTRACT_INDICATOR961094761666.87006436N
CORE_TAG01437250Y
CURRENCY139632409397.15220038N
DATE_ADDED489639476234.06714211N
DELIVERY_ADDRESS21437230.001391546Y
DELIVERY_CITY887965492961.78187511N
DELIVERY_STATE32201405052.240389633Y
DELIVERY_ZIP887965492961.78187511N
GRANDPARENT01437250Y
4 REPLIES 4
BrandonB
Alteryx
Alteryx

Another user in the community built a macro that performs this exact function! Here is the link to their post and their macro is attached:

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Remove-Null-Valued-Columns/td-p/424710

grossal
15 - Aurora
15 - Aurora

Hi @aklassen3,

 

you are on a good road, you just need a Dynamic Rename and Dynamic Select tool to finish the job. Here is how it would look:

 

grossal_0-1591975526893.png

 

What happens:

- We use the Dynamic Rename to update the Meta Data Description of each column with the 'Keep' field from your table

- We can than use the Dynamic Select to filter out all Values with 'N'

 

Settings:

grossal_1-1591975591849.png

grossal_2-1591975604779.png

 

I'll attach the workflow for reference. Let me know if it worked.

 

 

Best

Alex

 

aklassen3
5 - Atom

Thanks so much, @BrandonB . This definitely solves the roadblock I was having.

aklassen3
5 - Atom

Thanks @grossal ! This is very helpful.

Labels