Function for Average calculation in Flow Script

Have anyone created a cool Average function call to use in Flow scripts? I see that its not available as readymade function.

The use case is to calculate Control limits for a data series and determine directly in the client if the value is above or below UCL, LCL. In order to do that I need to process data and calculate some averages for different segments of data series.

An average function would come in handy.

1 Like

related but not specifically related question…is there a way to create a function that can be called from any script? Or are you asking about a function which would just be embedded in the script?


you can calculate an average in Flow script by using Sum() and Count() embeded functions of flow script:
sum(Table.Column) / count(Table)

If you need to reuse it multiple times within the same flow script step you can define it as a function in flow script

Sadly, I dont think there is a way to define a function once and then use it in other script steps.

Hope this helps!

Test script.flow (14.9 KB)

Great - thanks. That was what I was looking for. I know I cannot create permanent Functions in Flow.

Hi! I was looking for a specific shortcut to calculate AVG for a specific case that I’m working on. Functions cannot be created as global resources. However that would be a good idea for future functionality. Thanks for getting in touch.


I agree, this would be a powerful feature. The feature requests can be found in our Ideas Portal, the specific feature request can be found here: Global Functions for Cross-Script Usability in Flow Environment – How can we improve Novacura Flow?