• 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

    Best way to compare a previous time period on the same data point.

    Scripting general Discussion
    3
    13
    3.8k
    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.
    • phildunlapP
      phildunlap
      last edited by phildunlap

      What kind of source point? An accumulator or a power reading?

      Assuming something simple like a point that only has the day's kWh value, you could do....

      var yearAgo = new Date();
      yearAgo.setYear(yearAgo.getYear() - 1);
      var yearAgoValueTime = p.pointValueBefore( yearAgo.getTime() );
      return p.value - yearAgoValueTime.value;
      
      1 Reply Last reply Reply Quote 0
      • raylatbasixR
        raylatbasix
        last edited by

        Hi Phil,

        These are all kWh that I've calculated from kW's, and stored them per hour. So I would need to roll up and sum each days worth of kWh's over the course of a month exactly one year ago. I hope that makes sense.

        1 Reply Last reply Reply Quote 0
        • JoelHaggarJ
          JoelHaggar
          last edited by

          Do you need this stored in the database or can you do the rollups in the UI or reports. In both the Mango Dashboards and the Excel reports Mango has really good rollup functions so you can easily display the 1 month sum of your kWh values.

          1 Reply Last reply Reply Quote 0
          • raylatbasixR
            raylatbasix
            last edited by

            Hi Joel,

            I should be able to do the rollup in the UI (DGLux5). Basically looking to display current months worth of data along side the same month from last year.

            1 Reply Last reply Reply Quote 0
            • JoelHaggarJ
              JoelHaggar
              last edited by

              I think if you just keep 2 + years of data in Mango you should be able to do those time quires in DGLux.

              1 Reply Last reply Reply Quote 0
              • raylatbasixR
                raylatbasix
                last edited by

                Thanks Joel. I need to adjust my purge settings 2 years on all my points. What's the easiest way to do that without having to open each point and change them individually?

                1 Reply Last reply Reply Quote 0
                • JoelHaggarJ
                  JoelHaggar
                  last edited by

                  You should only need to do that on the System Settings page under the Purge settings.

                  By default all the data sources and points use the system purge settings. You can override this on a data source or data point level if you want.

                  1 Reply Last reply Reply Quote 0
                  • raylatbasixR
                    raylatbasix
                    last edited by

                    Thanks Joel, I did set that to 2 years on the System Purge settings, I guess I was expecting the individual points to reflect the new purge value, when looking at their settings. No big deal either way, as long as the system wide setting takes care of it.

                    1 Reply Last reply Reply Quote 0
                    • JoelHaggarJ
                      JoelHaggar
                      last edited by

                      As long as the check box for "over ride purge settings" isn't checked you are fine.

                      1 Reply Last reply Reply Quote 0
                      • raylatbasixR
                        raylatbasix
                        last edited by

                        Awesome, Thanks.

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