Error in Column Expressions node

I get the following error: “Errors in code. Please fix the expression.
Expected an operand’ but found ')”

My code is below. Not sure what i’m doing wrong.

if (column("% Complete by Cost")>100%)
{column("% Complete by Revenue")-100%}
else
{column("% Complete by Revenue")-column("% Complete by Cost")}

Hi @okapustina1221 and welcome to the Knime Community.

This should have been a separate topic as you are not trying to search for the existence of a substring.

Nonetheless, the issue here is that you are using “100%” as a mathematical value. You can only use numerical value, such as 100, 0, -100, 10.01, etc…

I cannot suggest anything as I cannot see your data. The % sign is actually an operator. It represents the mod operator, which gives you the remainder of a division. For example, 502 % 100 is 2.

So, if we look at your statement, it’s incomplete if you are using the % operator. That is why it complains that it’s expecting an operand after the %, but found ‘)’ instead.

3 Likes

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