in location

OR

I'm looking for

  • Wholesalers
    • Uncheck All Check All
  • EXPERTISE
    • Expand
    • Expand
    • Expand
    • Uncheck All Check All
  • Switchboard Manufacturers
    • Uncheck All Check All
OR

The best way to see what Clipsal electric products can do for your home is seeing them in action at a Clipsal Powerhouse Display Centre.

Product stock may vary according to location. If you're after a specific product range, please check with your chosen location before visiting.

10 Results
    Load More Load Complete
    Change Location

    How to define custom date range in PME Web Reports

    Issue
    A user would like to specify a reporting date range different from those included by default.

    Product Line
    Power Monitoring Expert 8.x

    Environment
    PME 8 Web Applications Reporting Resolution

    • PME 8 added the ability to define custom date ranges for the standard date range selector in Web Reporter.  The custom date ranges are defined in an XML file.
    • Finding the Custom Date Range File:
    Navigate to [PME Install Dir]\web\bin and find CustomDateRanges.xml

    *Warning: Take backups of any files prior to modifying them. Ensure the backups are in a location that will not be overwritten (i.e. the Desktop). 

     

    • Defining a Custom Date Range

    Within CustomDateRanges.xml:

    1. Each custom entry is defined within the '' and is defined within an '' element
    2. Each defined range must have a unique ID and it must be greater than 1000 to indicate to the PME system that this is a custom defined Date Range
    3. The 'DisplayName' is what will be shown to the end user of the system in the report date range drop-down control
    4. The 'StartDate' identifies the beginning of the time range
    5. The 'EndDate' identifies the end of the time range
    • Once you have added a new TimeDef block and saved the XML file it will appear in the drop-down in the data selector in Web Reporter.


    For Example: If a customer wants to add "last hour" as the time period to run the report for only last hour, the user can modify the CustomDateRanges.xml by adding following section at the very end of the XML file: 

                   " 
                     1029
                    Last Hour
                    Now.AddMinutes(-60)
                    Now
                   
    "




    Example 2: If a customer wants to add custom date range in order to run the report for "last hour to this hour", the user can modify the CustomDateRanges.xml by adding following section at the very end of the XML file: 

                    "
                           1030
                           Last                           Hour offset
                           last hour
                           this hour
                   





    NOTE: Please review below for basic information which can be used to configure your custom date range. 

    Date Range Expression Syntax
    Date ranges are specified by English-like phrases that mimic natural language. Following is a quick sample of what it looks like,
    • today
    • yesterday
    • last 7 days
    • last month
    • this year
    • next week
    Basic Ranges and Counts
    There are several predefined single word ranges that can be used on their own, or can appear in other expressions:
    • minute[s]
    • hour[s]
    • day[s]
    • week[s] month[s]
    • year[s]
    • dayofmonth
    • ::=  any numeric value written as digits, eg. (0,1, 123,-17), or any written out English word for the numbers 1 through 12 (‘one’, ‘two’,…)
    •  
    Times Relative to Now
    Predefined Intervals
    • today
    • tomorrow
    • yesterday
    Current Period
    • last < timeDimensionName>
    • this < timeDimensionName>
    • next < timeDimensionName>
    Ex: this week, next year, last hour
    Stretch Including Now
    • [the] next  <count> <timeDimensionName>
    • [the] last <count> <timeDimensionName>
    • Ex: “the next 3 weeks” goes from the start of the current week to the end of Saturday three weeks from now, so it can be up to 28 days.  “the last two hours” includes all of the current hour, plus the two hours prior to that.  You may add the final ‘s’ for plural time dimensions for readability but they are optional
    Offset From Now
    • <count> <timeDimensionName> ago
    • <count> <timeDimensionName> from now
    Ex: “22 hours ago” If it’s 4:50 pm, 22 hours ago is 6pm to 7pm yesterday.
    Years
    • year.nnnn
    Ex: “year.2004” runs from midnight Jan 1 (start of the day) to end of day Dec 31.
    Indexing and Filtering One Time Relative to Another
    • nth timeDimensionName>  [=<value>] {before | after } <timePoint>
    • nth  < timeDimensionName>  [=<value>] {before | after of in} <date range>
    Where
    • nth is a number followed by ‘st’ ‘nd’ ‘rd’ or ‘th’, like 1st, 2nd, 53rd, 99th etc, or an English number-word ‘first’ through ‘fourth’.
    • is any expression that evaluates to a single point in time (see below)
    • is any other date range expression
    • is the name of a day of week, or month, or the number for a minute or hour for filtering
    • Examples:       
      • 1st day=sunday of this year       
      • 7th week before startof(this month)       
      • second dayofmonth=20 before now
     
    Relative Offsets Within Intervals
    These are expressions like ‘this week last year’ which find the index of one time (this week) within another (this year) and then use that offset to move around in a different but related period (last year).You make them by simply putting two of the first four kinds of expressions listed above under ‘Times relative to now’ beside each other: { time relative to now } { time relative to now } Samples make this clearer:
    • This week last year
    • This month last year
    • This week last month
    • This month 3 years ago
    • This day last year
    • Next week last year
    • two weeks ago last year
     
    Explicit time ranges
    If none of the above combinations gives you what you want, you can combine them by explicitly naming the start and end of the period that you want separately.
    • from (<timePoint1> | to (<timePoint2> | ) to Endof()”.
    •  
    • Examples:
    • from Startof(second dayofmonth=20 before now) to Startof(first dayofmonth=20 before now)
      (this reproduces the ‘last 20th to 20th’ functionality of the previous implementation)
    • from startof(next hour) to endof(4 hours from now)
      (this reproduces the ‘next 4 hours’ functionality of the previous implementation)
    • from 3 weeks ago to 2 weeks ago
      from makedate(2009,06,01) to now
    • If you wanted to view data from a particular date onward, you could always have a predefined date range in the list.  makedate() creates a single time point that can participate in expressions
    Time Points
    • startof( )
      Picks the start time of the specified date range
    • endof( )
      Picks the end time of the specified date range
    • makedate( yy, mm, dd, [, hh, mm, ss])
      Makes an explicit date, like makedate(2009, 7, 13).
    • now
      The current time, to the second
    • eternity 
      Maximum possible date
     


    Example of implementation: Adding a "Last 3 Months" relative date range

    Add the blue highlighted entry to the bottom of the CustomDateRange.xml file then performs an iisreset by executing iisrest in a run window.

    .....
     
        10128
        Last 28th to 28th
        from 28th day in last month
        to 28th day in this month
     

       
        10129
        Last 3 Months
        Now.AddMonths(-3)
        Now
     




    With this setup, the report will return data from the previous 3 months through the date the report was generated.

    Alternatively, you could configure the reporting range as follows:

    .....
     
        10128
        Last 28th to 28th
        from 28th day in last month
        to 28th day in this month
     

       
        10129
        Last 3 Months
        from startof(Last 3 Months)
        to endof(Last Month)
     



    Or

    .....
     
        10128
        Last 28th to 28th
        from 28th day in last month
        to 28th day in this month
     

       
        10129
        Last 3 Months
        Last 3 Months
       
     




    With this setup, the reporting range will cover the previous three months before when the report was generated.


    This configuration will add a new relative range "Last 3 Months" in the Reporting Period selector.

    Didn’t find what you were looking for?

    Try Searching Again View Our Categories

    Need further assistance?

    Our Customer Care department provides total customer service solutions for our residential, industrial and commercial applications.

    Get Assistance