Hello - I have have created a new calculated column from some data and some of the results are over 100. I need to cap these values at 100. Can anyone please suggest how to do this in the math formula node? I can’t seem to get anything to work.

I got it working in the Rule Engine with $column$ > 100 => 100 - but this doesn’t work in the math node

Hello @rosyanna_098,

and welcome to KNIME Community!

You can use *min_in_args()* function from Math Formula node as following:

`min_in_args(yourCalculation, 100)`

Result will be either value from your calculation either 100. Whatever is less.

Br,

Ivan

6 Likes

Glad to hear that!

Ivan

Hi @rosyanna_098 , the Math Formula node also has an `if(condition, result-if-true, result-if-false)`

function similar to Excel’s if() statement,

e.g.

```
if($column1$ > 100, 100, $column1$)
```

which is the direct equivalent of Rule Engine’s

```
$column1$ > 100 => 100
TRUE => $column1$
```

Conditions can be nested, for example:

```
if($column1$ > 100,
100,
if($column1$ < 0,
0,
$column1$)
)
```

which would result in anything greater than 100 being 100, and less than zero becoming zero, and is the equivalent of:

```
$column1$ > 100 => 100
$column1$ < 0 => 0
TRUE => $column1$
```

4 Likes

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