Replace Value if Less than 0

Hi, is there any way to replace all column with minus value to 0 at once?

For example as per below table I want to directly convert all minus value to zero.


Hi @andersenyunan

I can think of a couple ways to do this.

The first is to use the Column Expressions node to evaluate whether the numbers in a given column are between a really low number and 0, and if they are, replaces them with 0.

You’d create a new expression for each column, all in the same node:

Alternatively, you can also do this (a little more elegantly) with a Java Snippet node:

1 Like

Another solution is the Math Formula (Multi Column) node.

You need to configure it to always output the Maximum of the value and 0 to return 0 for negative numbers and the value for positive. I made you a screenshot.


This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.