Skip to end of metadata
Go to start of metadata

The Range button in SuperWEB2 allows users to create custom ranges and quantiles:

There are several aspects of this feature that you can configure.

Configure Limits

You can set minimum and maximum limits, as well as a minimum value for the increment. These settings are configured using the ranges command in SuperADMIN.

The settings apply to both custom ranges and quantiles, although the increment will not apply to quantiles.

For example, to set limits for the Customer Profit field of the Retail Banking dataset (ID: bank), you could use a command similar to the following:

> ranges bank "Customer Profit" custom 10 10000 100

For more information, see the documentation for the ranges command.

Configure the Labels shown in the Field Tree

User defined ranges appear in the Ranges section of the field tree. By default, the different types are automatically labelled as follows:

Custom Ranges (exclusive):

Custom Ranges (inclusive):

Quantiles:

You can change the wording for the labels if you wish. The way to do this depends on whether your SuperWEB2 datasets are single language or multilingual:

Single Language Datasets

The language and number formatting used for the range and quantile labels will be based on the currently selected user interface language.

You can define the wording by editing <tomcat_home>\webapps\webapi\WEB-INF\classes\database_labels.properties.

There may be multiple copies of this file, with names like database_labels_en.properties, and database_labels_de.properties. These define the label text for the different user interface languages, so you will need to define your labels in multiple versions of the file, translated for each user interface language in use on your deployment. See Multilingual and Localisation Support - SuperWEB2 for more information about localisation and how SuperWEB2 uses the properties files.

Multilingual Datasets (Metadata Server)

The language and number formatting used for the range and quantile labels will be based on the currently selected dataset language.

You should define the label wording by adding properties to the keyword table in your external metadata database.

If a particular label is not defined in the keyword table for the currently selected dataset language, then SuperWEB2 will check for a database_labels.properties file that matches the current dataset language. If a properties file exists for this language, then SuperWEB2 will fall back to this and use the definition from the file instead.

Custom Ranges

To modify the labels for custom ranges, edit the following definitions in either the appropriate language versions of database_labels.properties or the keyword table, and change the wording:

Properties file:

udf-range-exclusive-first=Less than {Max}
udf-range-exclusive-range={Min} to less than {Max}
udf-range-exclusive-last={Min} or more
udf-range-inclusive-first={Max} or less
udf-range-inclusive-range=More than {Min} to {Max}
udf-range-inclusive-last=More than {Min}

Keyword Table:

ss_code
<lang>_name

udf-range-exclusive-first

Less than {Max}

udf-range-exclusive-range

{Min} to less than {Max}

udf-range-exclusive-last

{Min} or more

udf-range-inclusive-first

{Max} or less

udf-range-inclusive-range

More than {Min} to {Max}

udf-range-inclusive-last

More than {Min}

Each modified label can include no more than one occurrence each of {Min} and {Max}. These will be replaced with the lower and upper ends of the range.

In addition, you must not use any other instances of the characters { or }.

Quantile Ranges

To modify the label for quantiles, edit the following definition in either the appropriate language versions of database_labels.properties or the keyword table, and change the wording:

Properties file:

udf-quantile-range=Quantile {Num}: {Min} to {Max}
udf-quantile-range-with-rse=Quantile {Num}: {Min} to {Max} (RSE {Rse})

Keyword table:

ss_code
<lang>_name

udf-quantile-range

Quantile {Num}: {Min} to {Max}

udf-quantile-range-with-rseQuantile {Num}: {Min} to {Max} (RSE {Rse})

Each label:

  • Must contain a single occurrence of {Num}. This will be replaced with the number of this range within the quantile (starting from 1).
  • Can contain no more than one occurrence each of {Min} and {Max}. These will be replaced with the lower and upper ends of this range.
  • Must not use any other instances of the characters { or }.

If you have weighted databases, then the udf-quantile-range-with-rse string will be used instead. {Rse} will be replaced with the Relative Standard Error for the range.

Configure Number Formatting and Precision for Values in the Labels

If you want to apply custom number formatting and precision to the values in labels, then you can override the defaults by editing some settings in the configuration.properties file:

  1. Set numberFormat.enableCustomUDFValueFormat to true.
  2. Set numberFormat.customUDFValueFormat to your preferred custom format. See http://docs.oracle.com/javase/7/docs/api/java/text/DecimalFormat.html for details of the available formatting.

    For example, to force the use of three decimal places for all values in range labels, you could set this to 0.000:

    numberFormat.customUDFValueFormat=0.000
  3. Restart Tomcat or the SuperWEB2 service to apply your changes.

The number formatting and precision setting only apply to the {Min} and {Max} values. They do not apply to any {Rse} value in the label.

This setting applies to Table View only; it is not applied to table downloads.

Regardless of whether you apply custom formatting, the conventions of the selected language will be applied. For example, decimal places might be denoted by either a . or , character, depending on the current language:

English:

German:

Configure the Error Messages for Quantiles

If you attempt to create a quantile that does not satisfy the configured limits, SuperWEB2 displays an error message:

You can configure the text of these error messages by editing <tomcat_home>\webapps\webapi\WEB-INF\classes\common_labels.properties

There may be multiple copies of this file for different languages and locales, with names like common_labels_en.properties, and common_labels_en_AU.properties. You need to make these changes in all versions of the file. The properties file that is used will depend on the language settings in the end user's web browser and the set of supported locales defined in the faces-config.xml configuration file (see Multilingual and Localisation Support - SuperWEB2 for more information about localisation and how SuperWEB2 uses the properties files).

To change the error messages, edit the following lines:

ranges.quantile.error.invalidMin=     Minimum value allowed is {0}, while minimum calculated value with this configuration is {1}
ranges.quantile.error.invalidMax=     Maximum value allowed is {0}, while maximum calculated value with this configuration is {1}
ranges.quantile.error.invalidRanges=Calculated Quantile ranges are not valid:

Remove the Quantile Tab

You can also remove the quantile tab from the Range dialog if you do not want users to be able to create Quantiles.

Configure the Field Exclusion Rule for Quantiles

The field exclusion rules for tables allow you to limit the number of fields from a defined group that can be added to the table at any one time. If you have defined field exclusion rules for tables, you can choose whether these rules also apply to the quantile filter.

Apply the Table Field Exclusion Rules to the Quantile Filter

To apply the field exclusion rules from the table to quantile filters:

  1. Make sure you have followed the instructions to define and activate your field exclusion rules.
  2. Open <tomcat_home>\webapps\webapi\WEB-INF\data\.repository\RulesEngine.xml in a text editor.
  3. Make sure that the <rules:rule-name name="FieldExclusionRule"/> is specified within the QuantileFilterRules (and is not commented out):

    <rules:RulesPipe name="QuantileFilterRules">
      <rules:rule-name name="FieldExclusionRule"/>
    </rules:RulesPipe>
  4. Save your changes to the file (if any) and restart Tomcat or the SuperWEB2 service.

Stop Applying the Table Field Exclusion Rules to the Quantile Filter

If you do not want the table field exclusion rules to apply to quantile filters:

  1. Open <tomcat_home>\webapps\webapi\WEB-INF\data\.repository\RulesEngine.xml in a text editor.
  2. Comment out the <rules:rule-name name="FieldExclusionRule"/> within the QuantileFilterRules:

     <rules:RulesPipe name="QuantileFilterRules">
      <!-- <rules:rule-name name="FieldExclusionRule"/> -->
    </rules:RulesPipe>
  3. Save your changes to the file (if any) and restart Tomcat or the SuperWEB2 service.