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

Alteryx Designer Desktop Discussions

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

Remove NULL Columns - 2019.4

suby
11 - Bolide

Hi All,

 

I believe in the recent version of Alteryx you have the option to remove NULL columns on the Dat cleansing Tool.

 

We are in 2019.4 and i have some NULL values coming through and my requirement is to completely remove the NULL columns from the Data stream any thoughts.

7 REPLIES 7
AngelosPachis
16 - Nebula

Hey @suby ,

 

You can transpose your data and then filter out the null values. For columns that are 100% null, that will remove all records, and hence when you cross tab back to the original table structure those columns will not be there

 

Input :

 

AngelosPachis_1-1620293103513.png

 

 

Output:

AngelosPachis_0-1620293085826.png

 

Hope that helps,

 

Angelos

 

RishiK
Alteryx
Alteryx

@suby the attached workflow may help you.

danilang
19 - Altair
19 - Altair

Hi @suby 

 

Just a quick comparison of the two methods submitted above 

@AngelosPachis 

danilang_1-1620302131293.png

This method transposes all the data, removes the null records and then uses a cross tab to bring the data back to it's original shape without the null columns. 

Pros:

Easy to understand

Fairly quick

 

Cons :

Performs a cross tab operation on the complete data set

Renames the output columns replacing any characters that are not alpha or digits with underscores

Can reorder columns alphabetically

 

 

@RishiK 

danilang_2-1620302163321.png

 

This method transposes the data and then analyzes it by counting the number of null values in each column.  It then generates a new name for the null columns, renames the null columns in the original data using the Dynamic Rename and then removes the null columns from the dataset with the Dynamic Select.

 

Pros:

Faster since the the summarize operation is more efficient than the cross tab.

Doesn't rename or reorder the output columns

 

Cons:

More complex 

 

Summary

 

While both methods produce similar results, the dynamic rename and select is the preferred approach since it's faster and doesn't require field name cleanup and reordering

 

Dan

 

 

 

suby
11 - Bolide

Hi Dan,

 

Many thanks for the great explanation. 

 

Thank you will accept both as my solutions.

suby
11 - Bolide

Thank You.

suby
11 - Bolide

Thank you so much.

MI1
7 - Meteor

@danilang  or any one - I would like to order column based on the number of items per row, however when I used it is not working. Any solution can be done ?

 

MI1_0-1634298762584.png

 

Labels
Top Solution Authors