Add Grouping to Your Online DB Views


Adding Grouping

Adding Grouping to your online database views allows you to organize records into groups. Each group of records displays on your screen with a Group Header Title and may also include Subtotals such as Sum, Average and so forth. The views become instant "reports" online for quick decision making. If you need a hardcopy report, you can use GroveSite's Open In Excel capability for easy printing.

  1. Create a Custom View
    Login and click Org Admin > Manage Database to get to the Database Editor. Select [edit] next to the database you want to edit. In the views section, either select [edit] next to an existing custom view or select [new view] to create a new one.

  2. Define a Group
    Within the Edit Database Table View screen, you will see a Grouping and Sorting section. Under Group By, select the field(s) you wish to group by and whether to list the groups in ascending or descending order. You can choose up to three fields to group by. Once you have chosen these fields, be sure to select Save View and then Save Table.

    Picture DB Grouping and Sorting



  3. View the Groupings in your Database
    Now that you have defined the groupings in your custom view, go to your database page in your site. Select the new Custom View you defined. In our example below, the Custom View is named "Category". You will see your records displayed in the groups. Each group has a light yellow header that displays the Group name and number of records.

    Picture DB Grouping View




Defining Subtotals, Grand Totals and Other Aggregate Functions

  1. Choose What Field to Aggregate
    Select [edit] next to the same custom view you created your group(s) in. At the bottom of the screen you should see the Aggregate Functions area. Select from the Field Name drop down list the field you want to create an aggregate for. Only numeric fields from within your database will be shown here.

    Picture DB Grouping and Sorting



  2. Choose the Aggregate Function
    Now that your field is chosen, select which function you want the database to perform. You can choose between sum (total), min (minimum value), max (maximum value), and average.

    Picture DB Grouping and Sorting



  3. Choose Where to Display Values: Subtotals, Grand Totals or Both
    Determine whether or not you want the aggregate values to be displayed in a group's subtotal or a table's grand total -- or both. Be sure to click the Add Aggregate button way to the right of your screen and then click Save View.

    When you return to your site and select the Custom View, you will see your groups plus the aggregate values.

  4. View your Subtotals and Grand Totals on the database page

    Picture DB Grouping View