In SuperWEB2 you must have at least one summation option in the table at all times. When you first add a field to the table, SuperWEB2 automatically adds a summation option.
For example, for the Retail Banking database, the default summation option is a count of customers:
You can change the default summation option by modifying <tomcat_home>\webapps\webapi\WEB-INF\data\.repository\RulesEngine.xml
To change the default summation, you need to make two changes to the rules:
Step 1 - Define the Default Summation Rule
Locate the following section of code and remove the comments from the start and end (i.e. remove the
This includes one example rule for overriding the default summation: it changes the default summation option for the sample Retail Banking database to be the Mean of the Customer Profit summation option.
You can add multiple rules to set the default summation for each of your databases. Use the display name of the database to identify it, and then specify the display name of the fact table or summation option, followed by the statistical function. Valid functions include:
- MEDIAN (only available if the median has been enabled using the
cat addstatfunctioncommand for this database)
- COUNT (a count of the records in this fact table)
For weighted databases, you also need to specify the weight name in the rule, as follows:
For example, the following rule configures the default summation for the database called Weighted Survey to be the mean of the daily intake measure, using the person level weight:
Step 2 - Uncomment the Rule from CDataOnlineEditRules
Locate the following section:
Remove the comments from the OverrideDefaultSummationRule:
Once you have completed these changes, you will need to restart SuperWEB2 or the Tomcat service in order for the changes to take effect.