Alteryx Designer Desktop Discussions

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

Removing columns if certain rows are null

D_Y
8 - Asteroid

Hi everyone

 

I have a dataset that looks like this:

Record IDF1F2F3F4
[NULL][NULL]Building 1Building 2Building 2
512/31/2021200[NULL]654
812/31/2021300[NULL]200

 

I'm trying to remove column F3 entirely from the dataset because F4 already has the data for Building 2, so I want the dataset to look like this: 

Record IDF1F2F3 or F4 (this name doesn't matter)
[NULL][NULL]Building 1Building 2
512/31/2021200654
812/31/2021300200

 

Using the Select tool would not work because the column(s) with null rows to be removed differ each time.

  

For the purposes of this dataset, there will always only be 3 rows with the first row being NULL, but the Record ID numbers can change each time (this time it's NULL, 5 and 8, next time it could be NULL, 9 and 15). 

 

Thanks in advance for your help!

5 REPLIES 5
afv2688
16 - Nebula
16 - Nebula

Hello @D_Y ,

 

this is a small quick example to give you an idea about how to do it.

 

Regards

binuacs
21 - Polaris
Spoiler
binuacs_0-1637940415572.png

 

D_Y
8 - Asteroid

Hi @afv2688 @binuacs 

 

Thanks for your quick responses!

 

Unfortunately both of your solutions don't quite work because in this scenario, you're renaming the columns manually, however, I need it to be dynamic. 

 

For example, another input file may look like this, where I want column F2 removed: 

D_Y_0-1637945390085.png

 

I guess to summarize things, I'm looking for a way for Alteryx to dynamically remove any columns in which the last 2 rows are [null].

 

Another example, where I want to remove columns F3 and F4 but keep the rest. 

D_Y_0-1637945849179.png

 

I didn't want to rename the headers until after I remove the columns with null rows because what Alteryx changes the name of the second column if there are two headers that share the same name. This changes the name of the column to something different which doesn't work. 

 

Also, the [NULL] I wrote is actually just a null value from Alteryx ([null]), and not text that says "[NULL]". My apologies that I wasn't more clear in my original post. 

afv2688
16 - Nebula
16 - Nebula

Hello @D_Y ,

 

how about now?

 

Regards

D_Y
8 - Asteroid

Thanks! This works!

Labels
Top Solution Authors