Skip to Content

Aggregate Business Object at Panel Level

Vinyl supports the ability to aggregate a data object at the panel level. Supported options include Average, Count, Max, Min, and Sum as it relates to a Control. In addition, you can choose Expression, and then leverage a different customized aggregate value. Expressions will get re-evaluated upon a panel being filtered.

Note

You are required to use an aggregate function with the Expression field, returning only 1 row.

Panelexpression

How to Configure

In this example we'll take a look at the Orders Grid panel, where we have an existing Total Control being displayed. The underlying business object used to create this panel contains a column that creates an Alias named DayDateDiff, which calculates the days between when an Order is placed and when an Order is shipped. We'll use Expression to display an Average number of Days to Ship at the bottom of the Total Control.

  1. Navigate to the Panel you want to aggregate a Control on. For example: Orders Panel, Total Control
  2. Click the Action Drawer, select Live Designer
  3. Click the All Controls tab
  4. Locate the Control from the Controls panel, click the corresponding Open Record icon
  5. Select Expression as the Aggregate Function
  6. Input the appropriate aggregate function into the Aggregate Expression field. For example:

    'Avg. Days: ' || CAST(AVERAGE(DayDateDiff) AS string)
    
  7. Click Save

  8. Navigate back to the application view, refresh the web browser and confirm the change