| Aggregate Functions |
Tornado offers 4 type of Aggregate functions - Sum, Max, Min, Average and Count. Aggregate can be performed in both X and Y direction. User can specify the Sum function via Val() or Numeric. If Val() is used then 1 Box + 2 Boxes + 3 boxes = 6 while the Numeric option (default) will result 0.
Simple Aggregate SUM Function
|
<!--T_Aggregates_1.aspx-->
<script language='vb' runat='server'> |
In this example, the bottom Aggregate row template is defined as [[Field:Format]] for each field.
Advanced X-Y Aggregate Functions
|
<!--T_Aggregates_2.aspx-->
<script language="vb" runat="server"> |
The above code looks dense but actually most of the code is the display template of the bottom and right side aggregate data. This template enables you to customize the Aggregate row or column to your requirement.
Another variation of Aggregate function is the Export of the Aggregate data. Besides presenting the aggregate data with a grid, user may want to customize this data. For example, plot a chart of the aggregate data. The following is another version of the Remote Data example illustrating the export of the aggregate data to plot two charts.
Advanced Aggregate Data Export
|
<!--T_Aggregates_3.aspx--> <script
language="vb" runat="server"> |