Tutorial - Field Aggregation

In this tutorial we will show you how to setup Field Aggregation in PHPMaker. We will use the demo database for demonstration.

PHPMaker supports three types of Field Aggregation:

  • Total
  • Count
  • Average

The "Order Details Extended" view in the demo will be used in this example. We will set up "Field Average" for the Quantity field and "Field Total" for the ExtendedPrice field.

Fields in view "Order Details Extended"

 

Steps to Setup Field Aggregation

1. Loading PHPMaker

Open PHPMaker and connect to the demo database.

2. Setting up Field Aggregation

To set up the Field Average for the "Quantity" field, select the "Order Details Extended" View on Database pane and then click on the "Quantity" field. Select "AVERAGE" for the "Aggregate" column of this field.

To set up the Field Total for the "ExtendedPrice" field, select "TOTAL" for the "Aggregate" column of the "ExtendedPrice" field.

3. PHP Script Generation

Click the [Generate] button and PHPMaker will generate the required PHP scripts automatically.

4. Running the PHP Programs

The Field Aggregate will be shown in the footer of the "Order Details Extended" list page as follow:

 ©2002-2018 e.World Technology Ltd. All rights reserved.