Technical FAQs

Ask a Question

Can we change the definition of start and end hours for a day in Dashboards?

Issue:
Currently, a day is defined in PME dashboards as starting at 00:00 and ending at 23:59.

Product Line:
Power Monitoring Expert 7.2.2

Environment:
Power Monitoring Expert Software Configuration

Cause:
In some circumstances, it is possible days are defined differently than the standard where the day starts at 0:00 and ends at 23:59. In such cases, it would be pertinent to be able to modify the start and end hours for a day in dashboards.

Resolution:
*Warning: Irreparable database damage can occur. This procedure should only be performed by users familiar with SQL Server Management Studio. Databases should be backed up prior to performing this procedure.*

For dashboards, the date ranges are specified in the database using a domain language. It is natural language based and relatively intuitive. The database table in the ApplicationModules database called Time.Period contains details for the dashboard web application time range. To change the "start of day" from the default (midnight) to some other value, right click the table and select "Edit Top 200 Rows". Change the formula column to match your needs.

Below is an example that would specify 8:00AM as the "start of day". I'm showing the original table contents in the two left columns; edit the contents of the "Formula" column to match that in rightmost column. Note that the first 8 rows are not changed as the date range doesn't involve a natural day boundary.
 
TABLE: [ApplicationModules].[Time].[Period]
PeriodId Name Formula Change Formula to This
1 Last Hour last hour last hour
2 This Hour from this hour to startof (next hour) from this hour to startof (next hour)
3 Last 2 Hours from last hour to startof (next hour) from last hour to startof (next hour)
4 Last 4 Hours from 3 hours ago to startof (next hour) from 3 hours ago to startof (next hour)
5 Last 8 Hours from 7 hours ago to startof (next hour) from 7 hours ago to startof (next hour)
6 Last 12 Hours from 11 hours ago to startof (next hour) from 11 hours ago to startof (next hour)
7 Last 16 Hours from 15 hours ago to startof (next hour) from 15 hours ago to startof (next hour)
8 Last 24 Hours from 23 hours ago to startof (next hour) from 23 hours ago to startof (next hour)
9 Yesterday yesterday from first hour=8 in yesterday to startof(first hour=8 in today)
10 Today from startof (today) to now from first hour=8 in today to now
11 Last 7 Days from six days ago to now from first hour=8 in six days ago to now
12 Last 14 Days from 13 days ago to now from first hour=8 in 13 days ago to now
13 Last 30 Days from 29 days ago to now from first hour=8 in 29 days ago to now
14 Last Week last week from first hour=8 in last week to startof(first hour=8 in this week)
15 This Week (=Week to Date) from this week to now from first hour=8 in this week to now
16 Last 2 Weeks from last week to now from first hour=8 in last week to now
17 Last Month last month from first hour=8 in last month to startof(first hour=8 in this month)
18 This Month (=Month to Date) from this month to now from first hour=8 in this month to now
19 Last 2 Months from last month to now from first hour=8 in last month to now
20 Last Year last year from first hour=8 in last year to startof(first hour=8 in this year)
21 This Year (=Year to Date) from this year to now from first hour=8 in this year to now
22 Last 2 Years from last year to now from first hour=8 in last year to now

CAVEAT: These changes are not guaranteed to survive a software upgrade.
Was this helpful?
What can we do to improve the information ?