Skip to content

Python Transformation

The Python transformation is used in the enterprise version of process.science for Power BI to prepare the data. The package is designed so that the data can be transformed directly in the Power BI report. It creates four tables that can be used for analysis in Power BI.

Preparing the environment

To work with Python scripts in Power BI, you need to follow the steps from the Microsoft [documentation](https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-python-scripts).

Preparing the input table

Before the scripts can be used, you must ensure that your input table fulfils the following requirements. The column names for case_id, activity and timestamp are fixed and must be present in your input table.

Field NameDescriptionData TypeMandatory
case_idThrough this field the process instances can be differentiated.nvarchar
activityThis field describes the activity that has taken place.nvarchar
activity_groupedThis field describes the group of the activity that has taken place.nvarchar
timestampThis field describes when an event has taken place.datetime2
timestamp_endThis field can be used to calculate the duration of activities.datetime2
sort_keyThis field can be used to adjust the sorting of the event log.numeric
valueThis allows you to set the costs for the current event.numeric
automatedThis allows you to set wether the activity was automated or not.numeric
resourceThis allows you to set user information for each activity.‚Any
Additional Activity ValuesFurther information per activity, e.g. quantity of items. All fields, not matching other names will be mapped as additional activity values and will be stored in the newly created event log table.Any
Additional Cases ValuesFurther information per case, e.g. a company division. All fields starting with case_ will be mapped as additional cases values and will be stored in the newly created cases table.Any
Additional Activity Values GroupedFurther information per activity group, e.g. quantity of items. All fields ending with _grouped will be mapped as additional activity group values and will be stored in the newly created event log table.Any

Downloading the scripts

The scripts can always be downloaded in the latest version from our Self Service Portal. The scripts are contained in a ZIP file and must be unpacked.

Installation and configuration

Event log

The script createEventLog.py creates the table eventlog directly in the Power BI report, use this as a Python script step in the Event Log table in Power BI. This script is already included in our templates.

Cases table

The script createCasesData.py creates the table cases_data directly in the Power BI report, use this as a Python script step in the Cases Data table in Power BI. This script is already included in our templates.

Filter Tables

The filter tables are required to create the filters in Power BI. These are created directly in Power Query and do not require any Python scripts. Use our Power BI templates for this.