Trying to get the minimum value of a list of numeric records excluding the value 0. I found an example in StackExchange that looks something like this:
fieldX = min (filter (not_0, [!field1!, !field2!, !field3!, !field!]))
Code:
def not_0 (value):
Return value > 0
Tried in Pro, like this:
fieldX = MinimumValue(filter(not_0, [!field1!, !field2!, !field3!, !field!]))
Code:
def not_0 (value):
Return value > 0
But it doesn’t work because in the code block it’s an “invalid expression. No function was found with the name ‘MinimumValue’”.
I am not sure if it is because of the function filter or the script itself that causes the error.
Any idea on how to exclude the value 0 while still getting the minimum value? Thanks.