Datasheet
calculation for each group in the report. By performing the calculation with an SQL Expression field of
the following form, you use your database's ability to process Case Logic:
CASE DatabaseTable. "DatabaseField "
WHEN 'SpecifiedValue' THEN Calculation1
ELSE Calculation2
END
If a record's DatabaseField value is equal to SpecifiedValue, then Calculation1 is performed;
for all other records, Calculation2 is performed. By incorporating the SQL Expression field, you take
advantage of your database server's ability to process Case Logic. Your report's grouping consequently
takes place on the server, even when you summarize the SQL Expression field elsewhere in the report.
Note:
The SQL syntax in this example is specific to MS SQL Server 7. You may need to refer to your database
documentation or consult with your Administrator in order to determine the syntax appropriate to your
database.
6.6.5 Inserting summary and running total fields where possible
Where possible, avoid creating formulas with global variables to calculate summaries or running totals.
Instead, create summaries by clicking the Insert menu and then selecting the appropriate command
(Subtotal, Grand Total, or Summary). Create running total fields by opening the Field Explorer,
right-clicking Running Total Fields, and then selecting New from the shortcut menu.
For general details on summarizing data, see Sorting, Grouping, and Totaling and Running Totals.
2011-05-16128
Designing Optimized Web Reports










