Skip to main content
Solved

How can I set up a calculation to ignore values equal to 0 when calculating the mean?

  • May 5, 2023
  • 1 reply
  • 33 views

emerson_styles
Contributor
Forum|alt.badge.img+2

I have a shapefile with numerous columns that I need to calculate a mean for on a row by row basis. Within the data there are a lot of values equal to 0 that are skewing the mean - how can I set up a calculation in the ExpressionEvaluator to remove the 0's from my calculation?

Best answer by dustin

Nulls would not be evaluated in that situation, so I would use a NullAttributeMapper prior to the ExpressionEvalutor setting all 0's to <null>. Then after your ExpressionEvaluator, use another NullAttributeMapper to set <null> back to 0's.image

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

1 reply

dustin
Influencer
Forum|alt.badge.img+30
  • Influencer
  • Best Answer
  • May 5, 2023

Nulls would not be evaluated in that situation, so I would use a NullAttributeMapper prior to the ExpressionEvalutor setting all 0's to <null>. Then after your ExpressionEvaluator, use another NullAttributeMapper to set <null> back to 0's.image


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