Skip to main content
Skip table of contents

Scaling Factor and Precision - Data Control

You can use the supplied scaling plugin, outputscaling.dll to set a scale value to be applied to each cell in the table.

The scale factor will be applied to the cell values displayed in the client, as well as any downloaded data (including Excel, CSV and SDMX output).

Module Properties

The outputscaling.dll plugin has a number of properties that you can configure.

PropertyDescription
scale_factor

The scale factor to apply. Every cell value in the table will be divided by 10^n (where n is the scale_factor).

For example, if you set the scale_factor to 2 then each cell value in the table will be divided by 100 (10^2 = 100).

The default value of scale factor is 0 (i.e. no scaling applied to the table).

precision
The number of decimal places to round values to. Must be an integer value that is greater than or equal to 0.
annotation_symbol

A string value used to annotate the scaled results. For example, "#".

Make sure the symbol you specify does not clash with any annotation symbols for other Data Control modules. For example, the RSE annotation module uses the asterisk symbol for annotation.

annotation_description
A string value used for the annotation description. For example, "(x100)".
log_file

The name of a file to log information from the scaling plugin to.

This is optional. If you do not set the property, then the plugin will use a default value: outputscaling.log.txt, and save the log file to the SuperSERVER program data logs directory (if you installed to the default location the file will be saved as C:\ProgramData\STR\SuperSERVER SA\logs\outputscaling.log.txt).

If you choose to specify a log file name, then you can either:

  • Specify a relative path. The log file will be saved relative to the directory where the plugin DLL is located (C:\Program Files\STR\SuperSERVER SA by default).
  • Specify an absolute path. You must escape any Windows style directory separators (\) in the path with a backslash.

For example:

CODE
> method scaling output_scaling addproperty log_file "C:\\logs\\scaling_log.txt"
The scaling plugin does not write any output to the log file by default. See below for details about how to configure the log output.
measures_scale_file

The name of a configuration file for per measure scaling. You can use this setting to apply a different scaling factor depending on the measure in use in the table.

These settings will override the global scaling configuration for any measures specified in the configuration file.

The configuration file must be in Comma Separated Values (CSV) format, with the following fields (the file must not include any header row):

CODE
"Measure ID", "Statistics function name","Scale factor","Annotation Symbol","Annotation Description"

For example:

CODE
Cust_Profit,SUM,10,"+","(X10)"
Acc_Profit,SUM,100,"&","(X100)"

You can either specify the filename using an absolute path or a path relative to the location of the plugin DLL. You must escape any Windows style directory separators (\) in the path with a backslash.

Apply the Plugin to a Database

  1. Login to SuperADMIN and create a new method:

    CODE
    > method addmethod scaling mandatory scaling
  2. Add the Data Control plugin to the method:

    CODE
    > method scaling adddcplugin output_scaling outputscaling.dll 1
  3. Set the plugin properties:

    CODE
    > method scaling output_scaling addproperty scale_factor "2"
    > method scaling output_scaling addproperty precision "2"
    > method scaling output_scaling addproperty annotation_symbol "#"
    > method scaling output_scaling addproperty annotation_description "(x100)"
    > method scaling output_scaling addproperty log_file "output_scaling_logfile.txt"
    > method scaling output_scaling addproperty measures_scale_file "C:\\config\\scaling_file.csv"
  4. Assign the method to a database (in this example we are assigning the method to a database with the ID bank):

    CODE
    > cat bank addmethod scaling

    You can review the method details using the command cat <database_id> methods details <method_id>:

    CODE
    > cat bank methods details scaling
    [ Method : scaling (id:scaling) (type:mandatory) ]
        [ Common ]
        [ DCPlugin : outputscaling.dll (id:output_scaling) (priority:1) ]
            [ scale_factor : 2 ]
            [ precision : 2 ]
            [ annotation_symbol : # ]
            [ annotation_description : (x100) ]
            [ log_file : output_scaling_logfile.txt ]
            [ measures_scale_file : C:\\config\\scaling_file.csv ]

Configure Log Output

The Data Control plugins do not log any output by default. To activate log output:

  1. Open C:\ProgramData\STR\SuperSERVER SA\log4j.scsa.properties in a text editor.
  2. Locate the following section:

    BASH
    #Examples:
    #log4j.logger.AUDIT_DataServer=INFO
    #log4j.logger.AUDIT_DataServer.Dcapi=DEBUG
    #log4j.logger.AUDIT_DataServer.Dcapi.Callbacks=TRACE
  3. Remove the comment from the DataServer.Dcapi log statement:

    BASH
    #Examples:
    #log4j.logger.AUDIT_DataServer=INFO
    log4j.logger.AUDIT_DataServer.Dcapi=DEBUG
    #log4j.logger.AUDIT_DataServer.Dcapi.Callbacks=TRACE
  4. Restart SuperSERVER.

The plugin logs the configuration parameters and the input and output value for each value in the table.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.