Skip to main content
Solved

Would like to count features with null values


Forum|alt.badge.img+4

Let's say I have a table like this:

AttributeAAttributeBsome valuesome value

some value

some value

some value

some value

some value

And I want to summarize how many nulls are in each column (attribute) of a table like this:

AttributeA has 2 blanks / nulls.

AttributeB has 1 blanks / nulls.

What is the best way to count how many nulls are in a given column of a table?

Best answer by ciarab

@dmatranga one way would be to use the attributevalidator in 2016 to test for attributes that have a value. This will push all the records that fail your null test through the failed port. ( If you do not have 2016 or later you could use a tester to test your attribute is missing,null, empty)

If you then use the list exploder to split where it has nulls in more than one column, add a statistics calculator to count the number of failed messages

The Failed column will now give you a total count of Nulls for each, if you wanted to use a duplicate filter on the Failed column to remove the multiple records you will be left with a single record that contains the Failed Value and Validation Message you need.

hope that helps!

View original
Did this help you find an answer to your question?

3 replies

ciarab
Contributor
Forum|alt.badge.img+9
  • Contributor
  • Best Answer
  • August 2, 2016

@dmatranga one way would be to use the attributevalidator in 2016 to test for attributes that have a value. This will push all the records that fail your null test through the failed port. ( If you do not have 2016 or later you could use a tester to test your attribute is missing,null, empty)

If you then use the list exploder to split where it has nulls in more than one column, add a statistics calculator to count the number of failed messages

The Failed column will now give you a total count of Nulls for each, if you wanted to use a duplicate filter on the Failed column to remove the multiple records you will be left with a single record that contains the Failed Value and Validation Message you need.

hope that helps!


erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • August 2, 2016

Even simpler: Use the Tester to check if the attribute has a value and then use the StatisticsCalculator on the Failed port as mentioned by @ciarab.


Forum|alt.badge.img+4
  • Author
  • August 3, 2016

@ciarab @erik_jan Thank you both for your replies, going to try this now! I haven't used either of those transformers before, so I'm looking forward to checking these out.

Currently on the latest version of 2016.1


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings