Skip to main content
Solved

Not all values used in minimum-calculation


I have a shapefile with multiple float-fields. I want to calculate the minimum value of these fields. For some of the features the calculation is correct, but for some features the values are not used.

I use the AttributeCreator with the Arithmetic Editor: 

@min(@Value(BOVENGRENS),@Value(ONDERGRENS),@Value(WINTERPEIL),@Value(VAST_PEIL))

This gives the following result in the field Rekenpeil:

0684Q00000ArBmiQAF.jpg

Thank you for your replies!

Best answer by david_r

It's because of the NULL values, the value of min(n,NULL) = NULL, not n.

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

5 replies

david_r
Celebrity
  • Best Answer
  • April 12, 2018

It's because of the NULL values, the value of min(n,NULL) = NULL, not n.


  • Author
  • April 13, 2018

Then why is there a value in the first and fourth row? On those features there are also null values.


takashi
Influencer
  • April 13, 2018
tebont wrote:

Then why is there a value in the first and fourth row? On those features there are also null values.

Strange. The min function should return null always if one or more arguments were null. I was not able to reproduce the same situation as yours. Could you please share a minimal data and workspace which reproduce the situation?

 

 


david_r
Celebrity
  • April 13, 2018
tebont wrote:

Then why is there a value in the first and fourth row? On those features there are also null values.

I agree with Takashi, that's indeed unexpected. I wasn't able to reproduce that either.

  • Author
  • April 16, 2018

I can't send the file, but thanks to your replies I have used a NullAttributeMapper to change the Null values to Empty, which has solved my problem. Thank you!


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