Time Interval Range Normalizer

A time interval range normalizer chooses a result by comparing a time interval to time interval ranges specified in the normalizer. For each matching range, rating uses the index associated with that range.

The Time Interval Range normalizer works as follows:
  1. Define the time zone and the time interval to use in the normalizer template. A time interval is calculated as the end time minus the start time.
  2. For each defined integer range, if the time interval is equal to or greater than the lower boundary but less than the upper boundary, then the normalization value for the range is returned.
Negative time intervals (that is, the specified start time is greater than the end time) are supported.
The time zone defines the time zone to use for Date fields. One of:
  • event — Uses the time zone indicated by the incoming network message, which is impacted by the 3GPP-MS-Timezone and Event-Timestamp AVPs. This is the time zone where the event is initiated and is dependent on the initiator's current location, which can vary. It is the default.
  • initiator — Uses the time zone stored with the subscriber's profile information. This time zone is static and is typically the time zone of the subscriber's residence. It is not necessarily the same time zone in which an event is initiated.
  • system — Uses the time zone configured for the MATRIXX Engine. This time zone is also static. It is not necessarily the same time zone in which the system is physically located or indicated by the network message for the event.
  • utc — Based on the time of day of the event, interpreted in the UTC offset contained in the event message.
Note: The normalizer can compare fields containing Date or DateTime values. When you use a DateTime field, the normalizer uses the time and time zone set in the DateTime field. When you use a Date field, the system treats it as 00:00:00 in the time zone configured in the normalizer template.

You define the time interval for comparison by specifying the start time and the end time using one of the following values for each:

  • A field of the message or of a subscription data object.

    Available sources include fields from subscription objects, group objects, device objects, purchased items, network messages, operator-defined custom fields, and a variety of other sources.

  • A catalog item parameter.
  • The time of an event.

    For usage, the event time at which the usage authorization occurs. For usage rated by duration, if segmented to apply different rates for different portions of the usage, the time is an offset from the authorization time.

  • The start or end of the current period of the bill cycle for a subscription or group.
  • The start or end of the current period of a purchased item cycle. This option is valid only where the normalizer applies in a context for which a specific purchased item, such as in a final unit indicator (FUI) generator, exists.

You do not need to use the same type of value for the start and end times. For example, the starting time could be the ActivationTime field of a purchased offer, and the ending time could be the time of an event.

The specification of time interval ranges in the normalizer instance includes a set of range boundaries, and a quantity unit that applies to all the ranges. The allowed values for quantity units are: seconds, minutes, hours, days, weeks, months, and years. The range boundaries are integral values where the lowest range extends from negative infinity up to the lowest boundary, and the highest range extends from the highest boundary to positive infinity. The ranges are inclusive at the lower boundary and exclusive at the upper boundary.

For example, a time range interval normalizer instance could measure the interval between the activation time of a purchased item and the current time, and could produce values for ranges of that time interval, such as:
  • 0 for the range 0 to 2 months
  • 1 for the range 2 to 7 months
  • 2 for the range 7 to infinity months
The quantity unit basis is used to calculate the interval value by dividing the time interval (the start time minus the end time) by the quantity unit. The interval result is rounded down and any partial quantity unit amount is discarded. This provides a convenient way for calculating the difference between two points in time, such as the number of weeks following initial subscription, or the number of years since birth for age calculation.
Note: When comparing times that are close together, the behavior may not be what is required. For example, if the quantity unit is years, the start time is event time, and the end time is the 10th January 2022 00:00:00, then any event time between 10th January 2021 00:00:01 and 9th January 2023 23:59:59 (a period of almost two years) will result in an interval value of 0 when the normaliser is evaluated. The period of this 0 range decreases with smaller quantity units, and if the goal is to stop some logic being applied at a specific point in the future, then in this case, a smaller quantity unit, such as minutes, is recommended.

Time Interval Range Results shows example results for different quantity units and time ranges.

Table 1. Time Interval Range Results
Quantity Unit Start Time End Time Result
Yearly 2020-01-01T00:00:00.000000 2020-12-31T00:00:00.000000Z 0 years
Yearly 2023-01-01T00:00:00.000000

2021-12-31T00:00:00.000000Z

-1 years
Yearly 2020-06-20T00:00:00.000000 2021-06-19T00:00:00.000000Z 0 years
Yearly 2020-06-20T00:00:00.000000 2021-06-25T00:00:00.000000Z 1 year
Yearly 2020-06-20T00:00:00.000000 2021-06-20T01:00:00.000000Z 1 year
Monthly 2020-05-25T00:00:00.000000 2020-06-20T00:00:00.000000Z 0 months
Monthly 2020-02-19T00:00:00.000000 2020-03-20T00:00:00.000000Z 1 month
Weekly 2021-05-06T00:00:00.000000 (Thursday) 2021-05-09T00:00:00.000000Z (Monday) 0 weeks
Weekly 2021-05-06T00:00:00.000000 (Thursday) 2021-05-13T12:00:00.000000Z (Thursday) 1 week
Examples of scenarios where you would use a time interval normalizer are:
  • For providing different discount levels for subscriptions based on the length of time the customer has had the subscription. For example, to give different discounts to customers of one year and customers of five years.
  • For applying parental control policies to subscriptions if the user is younger than 18 years, based on the user's date of birth held in the subscription object as an extended attribute.