Custom metrics
To learn about custom metrics, see the Custom metrics section for IBM Process Mining Legacy.
In IBM Process Mining NextGen, custom metrics are created by using SQL, which replaced JavaScript coding that is used in IBM Process Mining Legacy.
For example, the following custom metric that is written in JavaScript counts the number of changes in each case:
var customMetric = {
caseMetric: function(aCase) {
var changes = 0;
for(var k = 0 ; k < aCase,size(); k++) {
var event = aCase.get(k);
var activity = event.getEventClass();
if(activity.indexOf('Change')>-1) changes++;
}
return changes;
}
};
In IBM Process Mining NextGen the same custom metric can be created by using SQL:
Data type: Numeric
count(activity)
Group by: Case ID
Where:
activity LIKE'%Change%'
The logic behind creating a Custom metric is the same as the logic used to configure queries in Analytics. For more information about creating queries, see the Creating queries topic.
For more examples of custom metrics in SQL, see the Examples of custom metrics topic.
In IBM Process Mining Legacy, each custom metric was related to the case. Each different case ID had a different value for a custom metric.
In IBM Process Mining NextGen a custom metric can be grouped by:
- Case ID
- Event
- Project
In addition, conditions can be used to calculate custom metrics only for certain cases. For example, priority = 'High'
condition applies the custom metric for cases with such priority.
You can specify the Activity interval of the custom metric. Use this feature to transform avg(pathtime)
into a custom metric to minimize the computation effort by storing the pathtime
value and computing
it only once, as a custom metric. For more information, see Configuring widgets.
You can choose to consider only the last event by using the Keep last switch.
Custom metrics and analytics are based on the same language in IBM Process Mining NextGen, so you can use all features of IBM Process Mining on an advanced level by using SQL.
Improvements
Custom metrics can be saved directly from the Analytics tab if the Dimensions option has a Case ID value. For more information, see Widgets and analytics.
Custom metrics as Advanced filters
In IBM Process Mining NextGen, the Advanced filter feature from IBM Process Mining Legacy is no longer available. Instead, you can use Custom metrics as Advanced filters. For more information, see the Custom metrics section the Filters topic.
JavaScript support
In addition to Custom metrics, IBM Process Mining NextGen no longer supports JavaScript advanced filters. Through the new custom metric approach, you can apply complex filters on your SQL custom metrics to achieve the same results.
However, elastic widgets in the Analytics still support JavaScript. For more information, see Analytics.