Negative values not showing in Math Formula percentage calculation

Hello,

I’m using the Math Formula node to calculate the percentage change between two columns. In some cases, the result should be negative, but the output only shows 0 or positive values.

What should I adjust to allow negative results?

Thank you.

Maybe you can provide an example where this supposedly happens

3 Likes

Sure, here’s an example:

  • Column1 (PreviousValue): 200

  • Column2 (CurrentValue): 150

Using the formula:

(($Column2$ - $Column1$) / $Column1$) * 100

I expect the result to be:

(150 - 200) / 200 * 100 = -25%

But instead of showing -25, the output just shows 0 (or sometimes a positive number).

Hmm, in 5.5.1 this works:

5 Likes

wow that is really strange - can you post a screenshot of this and share the workflow so we can try and reproduce?

2 Likes

With KNIME 5.5 I get the correct result (-25).

1 Like