We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Remove Records

Schu19
6 - Meteoroid

Hello, 

 

I'm running into an issue where once I've consolidated a few excel files, I end up with records that contain values of N/A, 0, or are Blank across the entire record, is there an easy way to remove these records from the data set prior to bringing into excel? They won't be consistent records that return these values each month so I'm hoping for a tool/process that will scan the consolidated data and remove all of the records that contain either N/A, 0, or blanks each month. For reference, one record/row may have all three values, or only 1 or 2, but they don't contain any data I need so would like to have removed. 

 

Thanks!

9 REPLIES 9
mceleavey
17 - Castor
17 - Castor

Hi @Schu19 ,

 

there are a few ways depending on your data.

 

1. Apply a Data Cleansing tool and remove null rows

2. Apply a filter and remove where a key field or fields are empty

3. More complex but might suit: Use the transpose tool grouped by your key field. Apply a filter and remove any empty fields from your value column and pivot back using crosstab.

 

Hope this helps,

 

M.



Bulien

TheOC
16 - Nebula
16 - Nebula

hey @Schu19 

Exactly as @mceleavey said, there are multiple ways to do this.

My instinct would be the filter tool. Given a mock setup:

TheOC_0-1620844611503.png


I can apply the following filter:

TheOC_1-1620844626098.png



And if any are null, they will drop out of the F anchor of the filter, leaving me with my data in the T anchor:

TheOC_2-1620844661191.png



I've attached this workflow if it helps.

Cheers,
TheOC

Cheers,
TheOC
Connect with me:
LinkedIn Bulien
Schu19
6 - Meteoroid

Thanks Mceleavey, 

 

I've tried removing null rows, however that retains the N/A values and 0 value records. 

 

Applying a filter requires me to apply an individual filter to each of the 15 columns so that I don't mistakenly remove data I need to keep, i.e. one column may be 0, however there is still data in the record I need, example Q1 is 0, however Q2 and Q3 contain needed values. 

 

I'm looking for a way to say, if the entire record across is Null, 0, blank, or N/A, then it can be removed, but if there is anything else in the record/row, keep the entire row"

 

Thanks. 

Schu19
6 - Meteoroid

Thanks TheOC, 

 

In your below example, I would still want to keep all of the records data, as some of the columns have required data,( ex. record 7, if though it has a null value in column 1, there is data in the other columns). I only want to remove the record/row if the entire record/row is null/blank/0/N/A. If the row contains anything other than those values, I'd want to keep it. 

TheOC
16 - Nebula
16 - Nebula

hey @Schu19 

I think this should solve it for you.

The only potential issue, is it replaces "N/A" with blank by the end of the workflow, 0's are converted back to 0's so that shouldn't be an issue.

TheOC_0-1620845986602.png

 



If a numeric contains a 0, I'm making it null:

TheOC_0-1620845894044.png


and if a string field contains "N/A" or empty, im making it null.

Then, as @mceleavey said with the data cleanse tool, removing null rows, and then replacing null with 0 for numerics and blank for strings:

TheOC_1-1620845945368.png



I hope this helps!
TheOC



Cheers,
TheOC
Connect with me:
LinkedIn Bulien
Schu19
6 - Meteoroid

So, I think we're very close, I've made all numerics that are 0 null, how do I make all text/vstring fields that are blank null as well? Sorry, fairly new at this. 

Schu19_0-1620847670158.png

 

Still running into these in my data because I think text fields that are blank aren't registering as null for the final data cleanse. 

Schu19_1-1620847755916.png

 

Thanks!

 

TheOC
16 - Nebula
16 - Nebula

hey @Schu19 

Thats perfect!
However, a multi-field formula tool can only change one type of data at once.
In this case, numeric. 
So i put a new Multi-field formula tool on, to convert both 'N/A', and '' in text fields, to null.

As in the attached workflow/screenshot below:

TheOC_0-1620847903282.png


make sure to change the dropdown in the top left of the configuration window to text fields, and you will want the following formula:
IIF([_CurrentField_] = "N/A" OR [_CurrentField_] = "", null(),[_CurrentField_])


Hope this helps!
TheOC

Cheers,
TheOC
Connect with me:
LinkedIn Bulien
Schu19
6 - Meteoroid

Awesome! Added a few more Multi-Row formulas and have the result I was hoping for, thanks!!

TheOC
16 - Nebula
16 - Nebula

Perfect! Glad you got it sorted!

Please feel free to accept mine and @mceleavey 's answer as solutions, to help people in the future, and give me a shout (my private messages are open, or this thread) if you need any further help!

Cheers!
TheOC

Cheers,
TheOC
Connect with me:
LinkedIn Bulien
Labels
Top Solution Authors