Overview
The Representative Case Attribute enrichment creates powerful case-level attributes by extracting and aggregating event attribute values from specific activities within each case. Unlike simple attribute extraction, this enrichment provides advanced aggregation options including sum, average, minimum, and maximum calculations, making it ideal for creating meaningful case-level metrics from event data.
This enrichment goes beyond basic first/last occurrence extraction by offering mathematical aggregations that reveal patterns and insights across multiple event occurrences. For example, you can calculate the total value of all invoice line items, find the average processing time across multiple approval steps, or identify the maximum discount percentage applied in any order modification. The enrichment also includes intelligent fallback options to handle cases where specific activities might not occur, ensuring robust data extraction even with process variations.
Common Uses
- Calculate total invoice value by summing all line item amounts from "Create Invoice Line" activities
- Determine average approval time across multiple approval activities in procurement processes
- Find the maximum discount percentage applied across all "Apply Discount" activities in sales orders
- Identify the minimum stock level recorded during any "Check Inventory" activity
- Extract the first customer contact person from "Customer Inquiry" activities
- Capture the last quality inspector from "Quality Check" activities
- Sum total shipping costs from multiple "Calculate Shipping" activities in logistics processes
- Average customer satisfaction scores from multiple "Customer Feedback" touchpoints
Settings
Filter: Optional filter to apply the enrichment only to specific cases. The enrichment will create attributes only for cases that match the filter criteria. Leave empty to apply to all cases in your dataset.
New Attribute Name: The name for the new case-level attribute that will be created. Choose a descriptive name that clearly indicates what the attribute represents, such as "Total Invoice Value", "Average Approval Time", or "Last Quality Inspector".
Event Column Name: Select the event attribute whose values you want to extract or aggregate. This could be numeric values for calculations (like amounts or durations), text values (like resource names or locations), or dates (like timestamps).
Case Representative Activity Names: Choose one or more activities from which to extract the attribute values. The enrichment will only consider events matching these activity names. For multiple activities, the aggregation will be performed across all matching events.
Case Representative Event Selection: Determines how to aggregate or select values when multiple matching events exist:
- First: Takes the value from the chronologically first matching event
- Last: Takes the value from the chronologically last matching event
- Sum: Adds up all values from matching events (numeric attributes only)
- Average: Calculates the mean of all values from matching events (numeric attributes only)
- Min: Finds the minimum value across all matching events
- Max: Finds the maximum value across all matching events
- All: Concatenates all values from matching events (creates a list)
Select Latest Event If Specifics Are Null: When enabled, if the specified activities don't contain the selected attribute (or the value is null), the enrichment will fall back to using the latest non-null value of that attribute from any activity in the case. This ensures you always get a value when possible, even if the specific activities don't have it.
Examples
Example 1: Total Invoice Value Calculation
Scenario: A procurement process has multiple "Add Invoice Line" activities, each with a "LineAmount" attribute. You need to calculate the total invoice value for each case.
Settings:
- Filter: (empty - apply to all cases)
- New Attribute Name: Total_Invoice_Value
- Event Column Name: LineAmount
- Case Representative Activity Names: Add Invoice Line
- Case Representative Event Selection: Sum
- Select Latest Event If Specifics Are Null: False
Output: Creates a case attribute "Total_Invoice_Value" containing the sum of all LineAmount values from "Add Invoice Line" activities. For a case with three invoice lines of $500, $750, and $250, the Total_Invoice_Value would be $1,500.
Insights: This enables analysis of invoice distributions, identification of high-value transactions requiring additional approval, and tracking of average invoice sizes over time.
Example 2: Average Approval Duration
Scenario: A loan approval process includes multiple approval stages ("Initial Approval", "Risk Approval", "Final Approval"), each with an "ApprovalDuration" attribute in hours. You want to know the average time spent in approvals.
Settings:
- Filter: (empty)
- New Attribute Name: Avg_Approval_Hours
- Event Column Name: ApprovalDuration
- Case Representative Activity Names: Initial Approval, Risk Approval, Final Approval
- Case Representative Event Selection: Average
- Select Latest Event If Specifics Are Null: False
Output: Creates "Avg_Approval_Hours" with the average duration across all approval activities. If approvals took 2, 4, and 3 hours respectively, the average would be 3 hours.
Insights: Identifies bottlenecks in the approval process, helps set realistic SLAs, and highlights cases with unusually long or short approval times.
Example 3: Maximum Discount Applied
Scenario: In a sales process, multiple discount activities can occur ("Manager Discount", "Seasonal Discount", "Volume Discount"), each with a "DiscountPercent" attribute. You need to track the highest discount given.
Settings:
- Filter: Process = "B2B Sales"
- New Attribute Name: Max_Discount_Percent
- Event Column Name: DiscountPercent
- Case Representative Activity Names: Manager Discount, Seasonal Discount, Volume Discount
- Case Representative Event Selection: Max
- Select Latest Event If Specifics Are Null: False
Output: Creates "Max_Discount_Percent" showing the highest discount percentage applied in each case. If discounts of 5%, 10%, and 7% were applied, the maximum would be 10%.
Insights: Helps monitor discount policies, identify cases with excessive discounts, and analyze the impact of discounting on profit margins.
Example 4: Last Responsible Warehouse with Fallback
Scenario: In a logistics process, items move through multiple warehouses. You want to identify the last warehouse that handled each shipment, but some activities might not have warehouse data.
Settings:
- Filter: (empty)
- New Attribute Name: Final_Warehouse
- Event Column Name: WarehouseLocation
- Case Representative Activity Names: Ship Item, Transfer Item, Store Item
- Case Representative Event Selection: Last
- Select Latest Event If Specifics Are Null: True
Output: Creates "Final_Warehouse" with the warehouse location from the last shipping/transfer/storage activity. If these specific activities don't have warehouse data, it falls back to the latest warehouse location from any activity in the case.
Insights: Enables tracking of final delivery points, analysis of warehouse utilization, and identification of shipping patterns.
Example 5: Minimum Stock Level During Order Processing
Scenario: An inventory management process checks stock levels at multiple points. You need to identify the lowest stock level encountered during order fulfillment to understand near-stockout situations.
Settings:
- Filter: Order_Type = "Rush Order"
- New Attribute Name: Min_Stock_Level
- Event Column Name: CurrentStockLevel
- Case Representative Activity Names: Check Stock, Reserve Inventory, Update Stock
- Case Representative Event Selection: Min
- Select Latest Event If Specifics Are Null: False
Output: Creates "Min_Stock_Level" showing the lowest stock level recorded during the order process. If stock checks showed 50, 25, and 30 units, the minimum would be 25.
Insights: Identifies orders at risk of stockout, helps optimize reorder points, and reveals patterns in inventory consumption.
Output
The Representative Case Attribute enrichment creates a single new case-level attribute with the name specified in the configuration. The data type of the new attribute matches the source event attribute, and the values are determined by the selected aggregation method.
Attribute Properties:
- Location: Case table (accessible in case attribute lists and filters)
- Data Type: Matches the source event attribute (numeric, text, date, boolean)
- Derivation: Marked as a derived attribute for lineage tracking
- Display Format: Inherits formatting from the source event attribute
Value Assignment Rules:
- Cases with matching activities receive values based on the aggregation selection
- Cases without matching activities receive null values (unless fallback is enabled)
- When fallback is enabled, null values are replaced with the latest non-null value from any activity
- Aggregations requiring numeric data (Sum, Average) only work with numeric event attributes
- The "All" selection creates concatenated lists of values
Integration Points:
- New attribute immediately available in case filters and calculators
- Can be used in subsequent enrichments as input
- Appears in data exports and API responses
- Available for visualization in charts and dashboards
- Can be combined with other case attributes in calculated fields
This documentation is part of the mindzie Studio process mining platform.