Aggregating data in a parent case

Define a calculation in a parent case to aggregate the run-time values of properties in child cases.

  1. In the navigation panel, click Cases, and then click the name of a parent case type.
  2. On the Settings tab, click Calculations.
  3. Click + Add calculation.
  4. Click + Add property.
  5. In the Calculated property field, press the Down Arrow key and select the name of a single-value property that is on a top-level page and stores an integer, decimal, or double.

    The calculated property stores the sum of other properties, across all child cases of the parent case.

    CAUTION:
    Ensure that this property is not associated with a declare expression because the value of the property can be overwritten.
  6. In the Case type field, press the Down Arrow key and select a class of a case type that is a child of your current case type.
  7. In the Property field, press the Down Arrow key and select name of a single-value property that is on a top-level page and is the same type as the Calculated property.
    At run time, the value of this watched property is added to the cumulative total of the calculated property.
  8. Click OK.
  9. Click Save to create the pyCaseTypeAggregates declare trigger that monitors the properties in the calculation.
    At run time, the value of the calculated property in the parent case is updated each time that a child case is saved and one of the watched properties has changed. If your application is unable to obtain a lock on the parent case to update the calculated property, it retries every 30 seconds.