Scaling Factor and Precision
You can use the supplied scaling plugin, outputscaling to set a scale value to be applied to each cell in the table, or to apply rounding to values.
Module Properties
The outputscaling plugin has a number of properties that you can configure.
Property | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
scale_factor | The scaling 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). | |||||||||
measure_scale_factor | The default scaling factor for measures. If this is not explicitly set, measures will use whatever is set for the scale_factor property. This can also be overridden for specific measures in the measures_scale_file CSV file. | |||||||||
precision | The rounding to apply to count values:
| |||||||||
measure_precision | The rounding to apply to measures. This can be set to either a positive or negative integer value, and works in the same way as the precision setting. | |||||||||
PropagateZeroes | Whether to propagate 0 rounded counts to measures:
| |||||||||
SuppressPropagatedZeroes | Can be used in conjunction with the If you set this to | |||||||||
OptionalAnnotations | This property can be used to turn off the default annotation settings for measures:
| |||||||||
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. | |||||||||
measure_annotation_symbol | The default annotation symbol for measures. If not explicitly set, measures will use whatever is set for the annotation_symbol . This can also be overridden for specific measures in the measures_scale_file CSV file. | |||||||||
annotation_description | A string value used for the annotation description. For example, Hundreds (values are scaled) . | |||||||||
measure_annotation_description | The default annotation description for measures. If not explicitly set, measures will use whatever is set for the annotation_description . This can also be overridden for specific measures in the measures_scale_file CSV file. | |||||||||
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:
For example:
CODE
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. This is optional. By default the The configuration file must be in Comma Separated Values (CSV) format, with the following fields (the file must not include any header row):
CODE
The function name can be one of the following: For example:
CODE
You can either specify the filename using an absolute path or a path relative to the location of the plugin. You must escape any Windows style directory separators (\) in the path with a backslash. |
Apply the Plugin
Login to SuperADMIN and create a new method:
CODE> method addmethod scaling mandatory scaling
Add the Data Control plugin to the method:
CODE> method scaling adddcplugin output_scaling outputscaling 1
Set the plugin properties:
CODE> method scaling output_scaling addproperty scale_factor "2" > method scaling output_scaling addproperty precision "0" > method scaling output_scaling addproperty measure_precision "-3" > method scaling output_scaling addproperty PropagateZeroes "Same" > method scaling output_scaling addproperty OptionalAnnotations "true" > method scaling output_scaling addproperty annotation_symbol "(x100)" > method scaling output_scaling addproperty annotation_description "Hundreds (values are scaled)" > method scaling output_scaling addproperty log_file "output_scaling_logfile.txt" > method scaling output_scaling addproperty measures_scale_file "C:\\config\\scaling_file.csv"
Assign the method to a dataset (in this example we are assigning the method to a dataset with the ID
bank
):CODE> cat bank addmethod scaling
You can review the method details using the command
cat <dataset_id> methods details <method_id>
:CODE> cat bank methods details scaling [ Method : scaling (id:scaling) (type:mandatory) ] [ Common ] [ DCPlugin : outputscaling (id:output_scaling) (priority:1) ] [ scale_factor : 2 ] [ precision : 0 ] [ measure_precision : -3 ] [ PropagateZeroes : Same ] [ OptionalAnnotations : true ] [ annotation_symbol : (x100) ] [ annotation_description : Hundreds (values are scaled) ] [ 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:
- Open C:\ProgramData\STR\SuperSERVER SA\log4j.scsa.xml in a text editor.
Locate the following section:
XML<logger name="AUDIT_DataServer.Dcapi" additivity="false"> <level value ="DEBUG" /> <appender-ref ref="MainLog" /> <appender-ref ref="CONSOLE"/> </logger>
By default, the above section is commented out. Uncomment the section.
XML--> <logger name="AUDIT_DataServer.Dcapi" additivity="false"> <level value ="DEBUG" /> <appender-ref ref="MainLog" /> <appender-ref ref="CONSOLE"/> </logger> <!--
- Restart SuperSERVER.
The plugin logs the configuration parameters and the input and output value for each value in the table.