Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have 2 variables: vTotOH and vTotOHBudget. If I put $(vTotOH) in a text box I get 239.7 which is correct. $(vTotOHBudget) gives 258.9 which is also correct. But if I put $(vTotOH)-$(vTotOHBudget) I get 203.9 instead of -19.2.
vTotOH is defined as $(vStaff)+$(vEquip)+$(vOps)+$(vAdmin)+$(vCentral)
vTotOHBudget is very similar (5 other variables added together)
Thanks
This is a common mistake very often made while handling variables. Simple reason could be understood from the below explanation I hope: Say you define two variables like:
vVar1 -> Sum(A)+Sum(B) // 10+5
vVar2 -> Sum(A)-Sum(C) // 10-2
Now your expression =$(vVar1)*$(vVar2) and you expect
(15+5)*(10-2)
But variable expansion actually makes it
15+5*10-2
To avoid this confusion you can put '=' in the front of your variable declaration. Hope this helps and makes sense.
Hi Adrian,
Can you please post your app.
Regards,
@vi
Hi Adrain,
Can you please share the sample file
Hi Adrian
Please try sum($(vStaff))+sum($(vEquip))+sum($(vOps))+sum($(vAdmin))+sum($(vCentral))
If you have null values and if you do not use sum it gives you different results
Thanks and regards
Padma
I get Error in Expression error message if I try this
This is a common mistake very often made while handling variables. Simple reason could be understood from the below explanation I hope: Say you define two variables like:
vVar1 -> Sum(A)+Sum(B) // 10+5
vVar2 -> Sum(A)-Sum(C) // 10-2
Now your expression =$(vVar1)*$(vVar2) and you expect
(15+5)*(10-2)
But variable expansion actually makes it
15+5*10-2
To avoid this confusion you can put '=' in the front of your variable declaration. Hope this helps and makes sense.
That works!!
Thanks