Copy link to clipboard
Copied
Hello, I created an interation in the past using Javascript to caluclate the sum of variables, now I am trying to calculate the average of variables, does anyone know if that is actually possible?
Copy link to clipboard
Copied
You do not need JavaScript to do this, and you did not really need JavaScript to calculate the sum of a number of variables.
You can just use the Expression action in a Standard Advanced Action to add the values of two variables together, repeating the process on subsequent action lines by adding the next variable value to the previous total.
Expression actions allow you to use Division, not just Addition, Subtraction and Multiplication. To calculate an average value across a number of variables, simply divide the final total by the number of variables involved.
Copy link to clipboard
Copied
Why make it easy when it can be done in a complicated way?
As Rod points already out, you don't need JS really. But my popping in is more about missing information in your question. Since you post this in the Captivate forum, I suppose you want to calculate the average for a CP project? There are many ways to calculate average of numbers in JS but:
Sorry for the cynical tone ... curse me, I don't care.