Set Precision for Summation Options
By default, SuperWEB2 displays values in tables as whole numbers (0 decimal places).
The display precision is determined by the value of the dataprecision
parameter in the CubeCatalog.xml configuration file. Changing this parameter will change the number of decimal places used globally for table display throughout SuperWEB2.
It is also possible to override the display precision for individual summation options.
For example, for the sample Retail Banking dataset you might want to display values for the Mean of Customer Profit to 2 decimal places, while continuing to show the other summation options with 0 decimal places.
Default Behaviour (Mean of Customer Profit and count of Customers both have 0 decimal places):
|
Precision Overriden (Mean of Customer Profit has 2 decimal places, but count of Customers still has 0 decimal places):
|
The precision settings are only intended to control the display of the values, and are not a security feature. If the derivations feature is enabled then users will be able to obtain the full unrounded value of any cell by creating a derivation and configuring its decimal places in the Advanced section of the Define Derivation dialog. The full unrounded values may also be exposed through the API and through downloads, depending on your configuration.
Step 1 - Set Precision in SuperADMIN
To set the precision for an individual summation option, you need to configure the displayoptions
in SuperADMIN:
- Start SuperADMIN.
- Log in as an administrator user.
-
Use the
displayoptions
command to set the display precision for your chosen summation option:TEXTdisplayoptions <dataset> <summation> set|clear numberOfDecimalPlaces <value>
Where:
-
<dataset>
is the dataset ID. -
<summation>
is the summation option to set the precision of. -
<value>
is the number of decimal places you want to show for this summation option.
For example, to set the display precision to two decimal places for the Customer Profit summation option in the Retail Banking dataset (id: bank), use the following command:
TEXT> displayoptions bank "Customer Profit" set numberOfDecimalPlaces 2 Customer Profit: numberOfDecimalPlaces: 2
-
-
Repeat for any other summation options that you want to change.
The precision settings defined in SuperADMIN only apply to SuperWEB2. They are not recognised by SuperCROSS or SuperVIEW.
Any changes you make to the displayoptions
setting in SuperADMIN will not be applied immediately to any users who are currently logged in and have the dataset open. The changes will apply when the users return to the dataset catalogue and reselect the dataset (or log out and log back in to SuperWEB2).
Check Existing Settings
You can check the existing settings for a dataset using the following command:
displayoptions <dataset>
For example:
Average Account Balance:
No display options configured
Account Profit:
No display options configured
Accounts:
No display options configured
Customer Profit:
No display options configured
Customers:
No display options configured
Use Regular Expressions
You can use regular expressions to check, set and clear multiple summation options. For example, you can use .
to match a single character, and .+
to match one or more characters. For example:
> displayoptions bank .+Profit set numberOfDecimalPlaces 2
Account Profit:
numberOfDecimalPlaces: 2
Customer Profit:
numberOfDecimalPlaces: 2
> displayoptions bank .+ set numberOfDecimalPlaces 3
Average Account Balance:
numberOfDecimalPlaces: 3
Account Profit:
numberOfDecimalPlaces: 3
Accounts:
numberOfDecimalPlaces: 3
Customer Profit:
numberOfDecimalPlaces: 3
Customers:
numberOfDecimalPlaces: 3
> displayoptions bank .+ clear numberOfDecimalPlaces
Average Account Balance:
No display options configured
Account Profit:
No display options configured
Accounts:
No display options configured
Customer Profit:
No display options configured
Customers:
No display options configured
Escape Any Special Characters
When setting or checking the display precision settings, you must use the display name of the summation option. If the name includes any of the following special characters, then you need to escape them by using a \
before the special character:
'"<>{}[]()$*:?/|
For example, if the display name of the summation option is "Total trip spend ($000)", you would write this as follows:
displayoptions MyDatasetID "Total trip spend \(\$000\)" set numberOfDecimalPlaces 0
Step 2 - Check the CubeCatalog Settings
You should also check the settings in <tomcat_home>\webapps\webapi\WEB-INF\data\repository\CubeCatalog.xml. These settings determine whether the displayoptions
settings are used for table display and download.
Open the file in a text editor, and check the following parameters:
Parameter | Configuration | ||||
---|---|---|---|---|---|
dataprecision |
The number of decimal places used globally to display tables in SuperWEB2 (this setting applies to table display in SuperWEB2 only; it does not affect the precision used in downloads). This level of precision will be used for all tables unless it has been overridden for the specific summation option. | ||||
useSummationPrecisionOnTableView |
Whether to use the
This setting defaults to | ||||
useSummationPrecisionOnDownload |
Whether to use the
This setting defaults to If you are using Job Queue Manager, then this has its own CubeCatalog.xml configuration file. You will also need to set the value of |
If you make any changes to the settings in CubeCatalog.xml, then you will need to restart Tomcat or the SuperWEB2 service for the changes to take effect.
Number Precision in Saved System TXDs and SuperWEB2 Derivations
In some cases, it is possible to override the precision settings for particular cells or entire tables:
- If you create tables in SuperCROSS and add them to SuperWEB2 as saved system tables , then some of the decimal place settings from the saved table will override SuperWEB2's precision settings. For example, you may have created derivations that have their own specific precision setting, or specified a custom precision for the entire table.
- It is also possible to create derivations in SuperWEB2 . In the Advanced settings of the Define Derivation dialog, you can set a custom number of decimal places for these derivations.
SuperWEB2 uses the following order of precedence when determining the number precision for each cell:
- If the cell is a derivation, any custom precision set for it will take precedence over any other settings.
- If the above does not apply, SuperWEB2 will use the custom precision saved in the TXD in SuperCROSS.
- If neither of the above apply, SuperWEB2 will apply the
displayoptions
precision for the selected summation option. - If none of the above apply, then SuperWEB2 uses the global
dataprecision
setting.
You can control whether SuperCROSS will save explicit precision settings in a TXD. See the documentation for the SetDecimalPlaces
setting in the SuperCROSS super.ini configuration file and the Edit > Options > Format > Decimal Places settings: Options
Disable Number Formatting for Downloads (Performance Improvement)
If your users are working with very large tables (tables containing millions of cells) then it can take several minutes to process them when downloading the table. It is possible to dramatically increase the performance of the download process by disabling number formatting in downloads.
If you are happy to have no number formatting applied to your downloads, you can achieve this performance improvement by setting download.formatNumbers
to false
in the configuration.properties file. See
configuration.properties
for more details.
Precision at the SuperSERVER Level
Please note that precision may also have been applied at the SuperSERVER level (for example using a Data Control module ).
If you configure the precision in SuperWEB2 to a greater number of decimal places than are being provided by the server, then although your chosen number of decimal places will display in SuperWEB2, your values will only be correct to the level of precision provided by the server.
For example, if the server is providing values to 1 decimal place, and you set the SuperWEB2 dataprecision
to 2, then SuperWEB2 will display values with 2 decimal places, but they will only be correct to 1 decimal place.