Skip to main content
Solved

Obtaining all attributes with "null" and "0" values from shapefile?


Forum|alt.badge.img

Hey guys,

I am trying to build a model which will give me the "null" and "0" count for a number of attributes from my shp. I have built a model using the attribute validator with the Validation Rule "Not Null" to obtain all Null values coming out from the failed output into a statistics calculator transformer where I have "_count" for Total Count Attribute: under Calculate Attributes.

To obtain the "0" values for my other attributes I input my attributes in Attribute Validator and used the validation rule "Contains Regex" with the [0] rule configuration. However this is not the correct was a it will also include subsequent zeros e.g.. "10, 100, 1000 etc."

My questions are; is the above method the correct and most effective way to obtain Null values and how can I use the regex function in the Attribute Validator or any other transformer to obtain "0" values?

Thanks in advance:)!

Best answer by ebygomm

You could also use an attribute creator with a conditional statement to create an attribute with value of 1 for any nulls or zeros and then sum these with a statistics calculator

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

3 replies

erik_jan
Contributor
Forum|alt.badge.img+19
  • Contributor
  • August 22, 2017

I believe you should use the regex "^0$".

The ^ indicates the start, the $ indicates the end.


ebygomm
Influencer
Forum|alt.badge.img+39
  • Influencer
  • August 22, 2017

You could amend your regex to ^0$


ebygomm
Influencer
Forum|alt.badge.img+39
  • Influencer
  • Best Answer
  • August 22, 2017

You could also use an attribute creator with a conditional statement to create an attribute with value of 1 for any nulls or zeros and then sum these with a statistics calculator


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