Creating Insights Using Complex Data

In this article, I will walk you through how to create a Chart Insight based on embedded data. You will also learn how to configure drill-down tables for charts and how to manage field aliases for chart legends and table columns.

Helpful Information About Data and Insights

  1. In Pega, insights are created from data that is optimized for reporting. Out of the box, scalar (non-reference) properties in both Case Types and Data Types are optimized for reporting .

  2. When you want to create insights based on reference or nested data, those fields must be explicitly optimized for reporting. For example, a scalar property in a Data Object is optimized for reporting by default only when the insight is created directly on that Data Object. However, if that same property is embedded in a Case Type and the reporting objective is to analyze values captured during case processing, the property must also be optimized for reporting for the Case Type cla ss

  3. Primary fields play an important role in determining which data is available in the Data Explorer, where insights are created. For a deeper explanation of this concept, refer to my article Effect of Primary Fields on Insights.

  4. In insights, field names are displayed exactly as they are stored in the system. For referenced fields, this means that the full property path is shown. For example, if a Customer data object is embedded in a case and the insight reports on the customer’s location, the default field name appears as Customer.Location. To display a more user-friendly name, you must configure a field ali as.

  5. By default, all newly created insights are displayed as Table. To visualize the data using charts (for example, a pie chart), you must manually change the insight’s presentation t ype.

Optimizing Fields for Repo rting

To optimize a field for reporting follow these steps:

  1. Switch to Dev Studio,

  2. From the App tab, search for the class (Work or Data) where the field is defined,

  3. Expand the object, then expand the Data Model, and then the Prope rty tabs,

  4. Navigate through the Property hierarchy and locate the embedded property that you want to optimize for reporting (see Figure 1 ),

Figure 1: Class structu re hierarchy

  1. Optionally if you want to verify existing reporting optimizations, follow these steps:

    1. Left click on the field and switch to advanced configuration,
    2. Open the “Advanced” tab,
    3. In the “Optimized for classes” section you can review the list of classes for which the property is already optimized (see Figure 2),

Figure 2: Review of Advanced tab and classes for which the property is a lready optimized

  1. (Only applicable for 24.2 version), to fix the known issue affecting report optimization, in the “Advanced” tab, clear the value in the “Additional Info” section (see Figure 3), and save the rule before c ontinuing.

Figure 3: Fixing the known reporting iss ue in 24.2 version

  1. In the class hierarchy, right click the target for optimization property and from the dropdown menu select “Optimize for reporting” option (se e Figure 4),

Figure 4: Initiating optimization process for the target field from the class hierarchy

  1. On the “Property Optimization” wizard, select the appropriate RuleSet Name and RuleSet Version for the generated Rule-Declare-I ndex (see Figure 5),

Click Next,

Figure 5: Pro perty optimization wizard

  1. Review the eligible classes and click Next ag ain (see Figure 6),

Figure 6: Review of classes during optimization process

  1. On the next screen click Finish to complete the optimiz ation (see figure 7),

Figure 7: Co mpleting optimization process

  1. For changes to take effect, log out of the application and log back in.

Reporting on Complex Data

In the context of insights, a field is considered complex if it is of type embedded data, data reference, case reference, or query. Such fields must be optimized for reporting when they are referenced from a different class than their source. In the next section, we create a Pie Chart Insight that reports on an embedded list of records field.

Scenario: Creating a Chart Insight to Report on the Percentage of Prerequisites Names for Trainings

In this scenario, we create a Chart Insight that shows the percentage of “Prerequisite Names” for all Training cases in a Training Management Application. The “Prerequisite name” is a field in the Prerequisite data object. The Training case type captures prerequisites during case processing using an embedded list of records field (see Figure 8).

Figure 8: Capturing prerequisites info rmation during case processing

Initially, the Prerequisite Name field is not available when creating insights from the Training case type (see Figure 9). The reason is that this field originates from a Data Object (Data class), but the insight is created on a Case Type (Work class). To resolve this, the property must be optimized for reporting from the Training (Work) class as well.

Figure 9: Unavailability of target field for reporting prior to optimization

After following the steps described in the “Optimizing Fields for Reporting” section earlier, the field becomes available for reporting (see Figure 10).

Figure 10: Field availability for reporting after optimization

Creating the Chart Insight

To create a Chart Insight, follow the steps described below.

  1. Open the Explore Data page in AppStudio,

  2. From the Explore Data drop down select the target object for creating insight. For our scenario, the object is Training (Case Type) since we are reporting on the data captured during case processing (see Figure 11),

Figure 11: Selecting t he target object from Explore Data

  1. Save as Insight to create a new insight (see Figure 12),

Fi gure 12: Creating a new insight

  1. Click “Edit” on the newly created insight. You can see that OOTB all insights are displayed as “Table”,
  2. Change Display as from “Table” to “Chart” and select “Pie” for the chart type (see Figure 13),

Figu re 13: Changing insight display

  1. In the Data tab, add the target field as a Dimension. For our scenario it is the Prerequisite Names,
  2. Ensure no other dimensions are present
  3. Add the Case ID field as a Measure with aggregation set to “Count” (see Figure 14),
  4. Optionally you can add Filters to filter data displayed based on specific criteria, add Promoted filters which allow you to display filter options within the insight for quick filtering, or Sort to configure the order data is presented.

Figure 14: Measure and Dimension configuration

Updating Field Alias

By default, insights display the full property reference (for example, Prerequisites.Prerequisite Names). To change this to a more user-friendly name follow the steps below:

  1. In Dimensions, open the three-dot menu next to the field

  2. Select “Change alias” (see Figure 15),

Figu r e 15: Configuration of field alias

  1. In the dialog, enter a user-friendly alias and submit (see Figure 16),

Figure 16: Adding a new alias

  1. Note that, irrespective of the insight type, all field names can be updated. For example, if you are creating a Table Insight the column names can be changed as described above.

Configuring the Chart Drill-Down Table

Clicking a segment of a chart opens a drill-down table, which displays the underlying data. There are two key behaviors for this table:

  1. The columns and their order are determined by the primary fields configured in the object’s data model,
  2. Only primary fields appear on the table.

For example, in our scenario, the Training case type initially has two primary fields; Label and Description where “Label” is ordered first and “Description” second. Hence, while viewing the drill-down table for a segment of the pie chart insight, only these two fields appear as columns (see Figure 17).

Figure 17: Viewing the pie chart drill-down table

To configure this table, for example, if we want to see more relevant information and change the order that this information is displayed, we must go to the data model of our object and mark the targeted fields as primary. Additionally, in the list of primary fields, we must order the fields according to the desired analysis sequence.

For our scenario, let’s assume that users want to explore the channel, provider and (if applicable) the provider organization’s name in the drill-down table in addition to the Training label and description. To achieve this, we mark “Channel”, “Provider”, and “Provider Organization Name” fields in our Training Case Type data model as primary. Next, we order the fields as required by the analysts. Figures 18 and 19 show the updated primary fields configuration and the resulting drill-down table.

Fi gure 18: Primary fields configuration

Figure 19: Resulting drill-down table

Enjoyed this article?

See suggested articles from our Constellation 101 series and view all our Knowledge Shares from our User Experience Expert Circle.

4 Likes

Thanks for sharing. Adding to Constellation 101: Constellation 101

2 Likes

Great step by step walkthrough!

1 Like

Great stuff! One thing to add on Caching of data in Explore data:

  • Infinity '24 open incognito or close all browser tabs and try again.
    • Failing that it gets a little trickier to clear it from your client side data:
      • Manual steps from Console: right-click Inspect → Application tab → on left side of this tab, expand Session storage > click on your environment (I’ve only ever seen there be one option) > right-click and Delete any rows where the key starts with your app (i.e. all ‘app/ken-25-app’ ones in this list should get deleted) > manual Refresh of browser tab is needed
  • Infinity '25 introduced a way to refresh easily check out How to refresh Data in Explore Data - Insight for new properties - User Experience - Pega Forums
2 Likes

Thanks, Marc, for the add on.

1 Like