Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.
Clever way to get pointvalues average disregarding 0's
-
I am looking for a simple method to calculate the average of a point-value array ignoring values that are 0's?
Is there anyway to use the statistics object with an array filter?
{{ ArrayValues | filter:{value: 0} }} -
@phillip-weeks said in Clever way to get pointvalues average disregarding 0's:
Is there anyway to use the statistics object with an array filter?
No. The statistics are calculated on the backend from a datapoint's values.
Your options are:
- Filter out the values and calculate the stats yourself on the frontend
- Create a meta datapoint which discards the zeros and run the statistics against that point
This thread is particularly pertinent -
https://forum.infiniteautomation.com/topic/4019/calculating-values-on-the-fly -
Thanks Jared I will create a new metapoint. :)