You can use all the expression manager system for this purpose. It's better to use an Equation for this purpose.