-
Expression within IF/ELSE expression for stopping after a threshold
I need some help figuring this expression out. I have a progress bar (0-100%) that has a label that follows the progress bar as shown below.
Here’s the code that is currently on the X Postion of the label:
764 - (100 - comp("MAIN").layer("CONTROLLER_PercentTargets").effect("Slider 1")("Slider"))*(764-112)/100;I’d like the label to stay fixed at 764px once it reached 100% (for my use the % has the potential to go above 100%), so my this is what I tried but it did not work and produced the result in the image above.
if(transform.xPosition<764){764 - (100 - comp("MAIN").layer("CONTROLLER_PercentTargets").effect("Sales Manager 1")("Slider"))*(764-112)/100} else {764};Presumably the answer to the above will also help me with adjusting the expression of the progress bar as well so that it doesn’t go beyond 100% scale on the x-axis.
Thanks!
