I'm looking for an automatic way to omit a column if every value is null. I've looked worked with elaborate workflows using transposes, summations, and cross tabs; as well as dynamic select which is where I believe my solution is. I tried using the expression:
!IsNull([IsNumeric]) || !IsNull([IsString])
but that didn't work. It would be nice to apply that function to all columns rather than include each in an OR statement, but I don't know how to do this.
If the input is this:
Line Item | Info | ID | UPC | Note |
1 | i1 | 245 | ||
2 | i2 | |||
3 | i3 | |||
4 | i4 | 362 | ||
5 | i5 |
then the result would be this:
Line Item | Info | ID |
1 | i1 | 245 |
2 | i2 | |
3 | i3 | |
4 | i4 | 362 |
5 | i5 |
Solved! Go to Solution.
You asked for it, so here it is. A new CReW macro that deletes all null columns (of your chosing).
Cheers & Happy Inspire18,
Mark
Thanks, Mark.
The macro failed to import. This is part of the window that popped up:
When I click Help > Check For Updates
It says "This version of Alteryx is up to date."
What version of Alteryx are you on?
I am attaching a version that should work on an older version of Alteryx.
Cheers,
Mark
This is pretty close. It gives an error that says:
Error: CReW Delete Empty Fields 8_1 (2): Tool #21: Parse Error at char(5): Unknown variable "#1"
I also found a weird quirk where data that was imported from an excel file showed up as empty if it was a string type and null if it was a numerical type. I didn't get the desired result right away and the Yes (Blanks & Spaces are Empty) toggle didn't work as expected. Not sure if this is a version issue or something else. This may be enough for my needs however because I can probably use the Select tool to change data types for to fix the quirk on real data. Any additional info on the error, these quirks, and the version I'm using is appreciated.
I'm on version 11.7.
Thank you, this helps a lot.
Forgot to mention that despite the error, it still actually worked, so I don't know what that's all about.