A range field consists of one or more custom ranges (for example "Account Balance < $500", "Account Balance $500 - $1000", "Account Balance > $1000").
You can define the range using fields that are measures, numerical or date/time fields.
To create a range field:
- Select Cross > Define Field. The Define Fields window displays.
- Click Range. The Range Field window displays.
Enter the following details:
Enter a name for the field.
Field to Range
Select the field you want to create a range for.
From and To section
Enter the start and end points of the range in the From and To fields and then click Insert to add the range to the list of Current Ranges.
- Use the < and <= radio buttons to select whether the range includes the start and end points.
- You can leave the From field empty to create a range that includes all values below the To value.
- You can leave the To field empty to create a range that includes all values above the From value.
If you try to insert a range that overlaps one of your existing ranges, SuperCROSS will warn you about it and you can choose whether to continue (in which case SuperCROSS will automatically remove the overlapping existing ranges and replace them with the new range.
Use the Increment field to automatically create a series of equally sized ranges between two values.
For example, if you enter the following values:
SuperCROSS creates the following ranges:
Insert a range into the Current Ranges list.
Select a range from the Current Ranges list and then click Delete to remove the range.
- Click OK.
Note About Time Calculations
By default, SuperSTAR uses an estimated method for calculating the difference between dates.
If you request that the difference between two dates is specified in years then the value is calculated by dividing by 365.25 (i.e. the effect of leap years is averaged out). This can result in inaccuracies if you calculate a range UDF on top of a time span UDF for dates that are on exact year boundaries. In this case the computed value will be slightly greater, or slightly less than the integer multiple of years depending on how many leap days fall into the range.
For example, if you calculate the days between 1/1/2001 and 1/1/2002 then SuperCROSS returns 365 / 365.25 = 0.9993, whereas a user (and the range UDF) would expect the result to be exactly 1 year.
As an alternative, SuperCROSS can use a different time calculation: discrete time calculation. When this mode is active, SuperCROSS computes, in addition to the total number of days, the integer value of the number of whole years, whole months and remaining days. Instead of averaging from the total number of days, it uses the following calculations:
datespan in years = nYears + (nMonths / 12) + (nDays / 365.25) datespan in months = nYears*12 + nMonths + (nDays / (365.25/12))
In the example above, this calculation results in the expected whole number result for a full year.
To enable the calculation you need to create the following environment variable and set it to true: