Skip to main content
Solved

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

  • August 22, 2017
  • 3 replies
  • 46 views

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

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

erik_jan
Contributor
Forum|alt.badge.img+23
  • 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+46
  • Influencer
  • August 22, 2017

You could amend your regex to ^0$


ebygomm
Influencer
Forum|alt.badge.img+46
  • 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