Indirect Addressing in Expression Error

I get an error when I change my expression from direct addressing to indirect.
This expression works:

toInt({PDM Line 1/Product Run/Caculations/runTime}) + ":" + if({PDM Line 1/Product Run/Caculations/runTime}%60<10, "0","")+ {PDM Line 1/Product Run/Caculations/runTime}%60 + " Calculated Runtime"

But when I change it to this:

toInt(tag({Root Container.lineName} + "/Product Run/Caculations/runTime")/60) + ":" + if(tag({Root Container.lineName} + "/Product Run/Caculations/runTime")%60<10, "0","")+ tag({Root Container.lineName} + "/Product Run/Caculations/runTime")%60 + " Calculated Runtime"

I get this error
"Type mismatch in operation ‘DIVIDE’. expected ‘Number’ , found ‘Object’

I didn’t correct the entire expression- however the first line parens syntax is off:

toInt(tag({Root Container.lineName} + “/Product Run/Caculations/runTime”)/60) + “:” +

should be

toInt(tag({Root Container.lineName} + “/Product Run/Caculations/runTime”)) /60 + “:” +

need to get the object to a value, then do the math

Right, here is the correct expression:(toInt(tag({Root Container.lineName} + "/Product Run/Caculations/runTime"))/60) + ":" + if((toInt(tag({Root Container.lineName} + "/Product Run/Caculations/runTime"))%60)<10, "0","")+ (toInt(tag({Root Container.lineName} + "/Product Run/Caculations/runTime"))%60) + " Calculated Runtime"

Thanks for the help. I’m getting a similar error on this code as well

if(tag({Root Container.lineName} + "/Product Run/Caculations/caseHourActualDiff") <= 0, 90, -90)

What I don’t understand about this error is this expression will work with this code:

if({PDM Line 1/Product Run/Caculations/caseHourActualDiff} <= 0, 90, -90)

But when I make it dynamic I get the error.

Type mismatch in operation ‘Less Than or Equal’ expected ‘Number’, found ‘Object’

How does making this dynamic change it into an object?
The tag “caseHourActualDiff” is of type INT.

[quote=“jlr573”]Thanks for the help. I’m getting a similar error on this code as well

if(tag({Root Container.lineName} + "/Product Run/Caculations/caseHourActualDiff")[color=#FF0000])[/color] <= 0, 90, -90)


You were still missing a closing parenthesis.

weird. double post.

That doesn’t work either because The second closing parenthesis end the “if(” statement. Causing the argument to fail.

You need to coerce the object into a value.

Try this;
if(toInt(tag({Root Container.lineName} + “/Product Run/Caculations/caseHourActualDiff”)) <= 0, 90, -90)

Thanks markdobtech
That was the ticket!