Database Data Group - 6 -
Calculations Tab
The Calculation tab is used to define the client-side calculations which will appear as sub totals and
grand totals in the output given by the Scope.
Scope
Grand
Grand provides a calculation for the entire set of data returned. For example, if the group returns
temperature records over the day, this can be used to calculate the minimum and maximum
temperature over the day.
Sub
Sub provides subtotal calculations based on the column selected. The columns listed are all of
those set up under the Order tab. This will provide a calculation after each distinct value for the
selected column.
If a datetime column is selected, additional date options become available (XLRyear, XLRmonth,
XLRday, XLRhour, XLRminute, XLRsecond).
For example, if the group returns the timestamp and temperature records over the day, Sub can be
used along with the XLRhour of the timestamp to calculate the minimum and maximum of the
temperature over each hour of the day.
Calculation
Type
The calculation to perform. The following are available:
• total
• minimum
• maximum
• average
• count
On
The column to perform the calculation on.
SQL Tab
SQL Statement
If the query is constructed using on the previous tabs, the SQL statement parameter displays the SQL
statement based on the settings.
Custom Query
An alternate approach to designing the query is to use the SQL tab exclusively. If the query has not
been formed by the previous tabs, the SQL Statement is editable so that a query may be manually
entered using any SQL syntax acceptable by the database engine underlying the Connector.
Stored Procedure
A stored procedure is a set of SQL statements with an assigned named that can be run by issuing an
EXEC or EXECUTE command.
Stored procedures are processed by XLReporter in two ways, depending upon the configuration of the
procedure.
If the stored procedure is used to populate a table in the database, the procedure must be executed in
the Stored Procedure parameter so that the table can be queried by the statement in the SQL
Statement parameter. At the runtime of the data group, the stored procedure is processed first,
followed by the SQL statement.