• Recent
    • Tags
    • Popular
    • Register
    • Login

    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.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    Clever way to get pointvalues average disregarding 0's

    User help
    2
    3
    772
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      Phillip Weeks
      last edited by

      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} }}

      Jared WiltshireJ 1 Reply Last reply Reply Quote 0
      • Jared WiltshireJ
        Jared Wiltshire @Phillip Weeks
        last edited by Jared Wiltshire

        @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

        Developer at Radix IoT

        1 Reply Last reply Reply Quote 0
        • P
          Phillip Weeks
          last edited by

          Thanks Jared I will create a new metapoint. :)

          1 Reply Last reply Reply Quote 0
          • First post
            Last post