Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I've noticed before that when doing arithmetic with variables, I often need to put parentheses around them, but that's not working this time. Here's the deal:
I have 3 Variables:
1) vCurrentMonthLeadGoal - contains the lead goal for this month.
2) vCurrentMonthWorkDays - contains the number of workdays in this month.
3) vMTDWorkDays - contains the number of workdays from the beginning of this month to today.
Each of the above variables works on its own. However, when I try to combine the three to create a 4th variable, I run into a problem. My fourth variable is meant to calculate today's lead "target", which is essentially just where we should be today to meet this month's goal. The formula is as follows:
($(vCurrentMonthLeadGoal))
/
($(vCurrentMonthWorkDays))
*
($(vMTDWorkDays))
This just gives me a "-". Any solution?
Thanks in advance for the help.
EDIT:
The vCurrentMonthLeadGoal is made up of a collection of sums:
Sum(Expression1)
+
Sum(Expression2)
+
Sum(Expression3)
I took the ceiling of this expression, and everything is working fine now:
Ceil(
Sum(Expression1)
+
Sum(Expression2)
+
Sum(Expression3)
)
That said, I'd still like to know why it behaves this way. If anyone could enlighten me, I would appreciate it.
I think the reason is your default number-formatting which probably used the comma as decimal delimiter. This means vCurrentMonthLeadGoal returned probably something like 100,50 which is fine if applied anywhere as a single-expression but is invalid as part of further calculations because it regards the comma than as a parameter delimiter.
To solve this you could change the default formatting (in the script-variables in script-tab main but be careful - it might have side-effects to other interpretations/calculations in script and UI of your application) or you used a formatting like:
num(($(vCurrentMonthLeadGoal)), '# ##0.##', '.', ' ')
- Marcus