Expression math using tags

Here is my expression to calculate a low limit:
tag({Root Container.TITLE} + “_Blend_SP/FMB A Blend A SP”) - tag({Root Container.TITLE} + “_Calc/SP Tolerance”)

FMB_A SP_A = 65
SP Tolerance = 2
result = 67
Good

But
Here is my expression to calculate the upper limit:
tag({Root Container.TITLE} + “_Blend_SP/FMB A Blend A SP”) + tag({Root Container.TITLE} + “_Calc/SP Tolerance”)

FMB_A SP_A = 65
SP Tolerance = 2
result = 65.02
Not so good

What am i doing worng?

Thank you

I’ve created the same situation on my project and it does the same thing :fearful:
I don’t know what is going on here :sweat_smile: but I’ve fixed it like this:

toInt(tag({Root Container.TITLE} + "/BlendSP/FMB A Blend A SP")) + toInt(tag({Root Container.TITLE} + "/_Calc/SP Tolerance"))

Y’all should wean yourself off of the tag() expression function. Use custom properties bound indirectly to your tags, then use those properties in your final expressions. This minimizes what executes as tag changes are distributed.

1 Like

That seems to be an excellent suggestion.
I’m a newbie to object orientation. Suggestions like this one really help me better understand the new environment.

Is this just good OOP practice? or is there something worng with the tag() function?

Bindings execute all-or-nothing. When using the tag() function, you have both indirects and tag values involved together, any change of which will cause the whole expression to re-execute. If you move the indirects to their own bindings, the final expression doesn't have to re-execute indirects that haven't changed.