Best way to compare a previous time period on the same data point.
-
Hi Phil,
Sorry for the late reply. I think you answered my question. I have been using meta points, and have been generating history on those points. It just seems like I am storing the same history values twice in some cases when talking about the same data point (i.e. todays values versus yesterdays values), and was looking for a query to run on the fly on the existing data point history, that could be associated with a meta point. I will continue with What I have been doing and storing those values in a meta point.
You may be able to help with a particular meta script though. How would I compare each days total kWh in the current month & year to the same days and month from last year? -
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;
-
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.
-
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.
-
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.
-
I think if you just keep 2 + years of data in Mango you should be able to do those time quires in DGLux.
-
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?
-
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.
-
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.
-
As long as the check box for "over ride purge settings" isn't checked you are fine.
-
Awesome, Thanks.