Follow

How to calculate an on-going average

To maintain an ongoing average, you only need maintain a count of total number of values and the last average calculation. The first value is a special case but from then on you can calculate the new average as the values arrive.

Remember that Conducttr processes beats in parallel and actions within a beat in the order they were created. Hence if you need to sequence a calculation, as we do here, you need to create the Change actions in the order you with them executed.

In the example below, each |new_value| is parsed from an incoming email.

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments