Looking for syntax on how to check automation variable's value to zero.
I later divide by this variable varTotalCountSmart, so need to add a condition before the math function to not execute the create variable varEpicCompletion if varTotalCountSmart is equal to 0
calculation
varTotalCountSmart
varTotalCountSmart
Without seeing your entire rule, what do you want to happen when the total count is 0?
Let's assume you want the varEpicCompletion to be 0 also.
There are several ways to handle this, and the simplest is to use an inline condition to substitute a value when it is 0, such as 1. This could be done in either variable because if the total count is 0, the done count is also likely 0; thus 0 / 1 = 0.
{{#=}} FLOOR( {{varDoneCount}} / {{if(varTotalCount.asNumber.gt(0), varTotalCount, 1)}} * 100) {{/}}
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.