Skip to Content

MIN function with NULL values in Calculation View

Hello Everyone.

"Min" function in Calculation View if one of the arguments is NULL and other arguments not NULL returns 0 as result. But my requirement is: exclude NULL values (if exists) from "min" calculation. I'am currently exclude NULL values via "IsNull" function for two arguments, but if arguments greater then two this is difficult to exlude NULLs with "IsNull" function.

Please, advice me how can I do this?

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • Posted on Mar 26 at 06:48 AM

    One option would be to replace the null values with a kind of "not regular available" max. value. This would allow you to use combinations of functions min, if and isnull.

    For instance something like that:

    min( if(isnull("value1", 999999, "value1")), if(isnull("value2", 999999, "value2")) )

    This works of course just in case at least one column has a value and you can ensure that the "max. value" used is not available as regular value. In case each column can be null, the whole min function can be surrounded by another if function checking for the used max. value and returning null in that case.

    Add comment
    10|10000 characters needed characters exceeded