Showing results for 
Search instead for 
Do you mean 

How does one exclude zero when using the MIN function in Functional Attributes?

by Anonymous on ‎03-31-2016 12:49 PM - edited on ‎04-06-2016 01:37 PM by Moderator (177 Views)

Question

Given a set of attribute data that contains '0' as a possible value, the user wants to query out the minimum value for the attribute that is not '0'.

Answer

The following syntax to be applied to a feature class where four address attributes are being considered (L_F_Add, L_T_Add, R_F_Add, R_T_Add):

 

Try the following against your dataset. The 999999 value is arbitrary and just needs to be a value higher than your largest attribute value.

 

MIN(IF(Input.L_F_ADD=0, 999999, Input.L_F_ADD), IF(Input.R_F_ADD=0, 999999, Input.R_F_ADD), IF(Input.L_T_ADD=0, 999999, Input.L_T_ADD), IF(Input.R_T_ADD=0, 999999, Input.R_T_ADD))

Contributors