Exercise - Event log transformation

Completed

To make your data more useful and easier to understand, you might need to perform other transformations. Steps that you might need to complete include:

  • Rename columns for clarity and consistency.

  • Filter out irrelevant activities from the dataset.

  • Change column types.

  • Replace values.

Objectives

Your learning objectives for this exercise are to:

  • Review and prepare data.

  • Change column types and rename columns.

  • Filter rows.

  • Replace values.

  • Rename steps.

Required fields

For process mining to analyze your event logs, the following fields are required: Case ID, Activity, and Event Start.

Prepare data and load

You receive a dataset in CSV format. You want to review the data, make sure that the dataset includes all required fields, and then create the process.

High-level steps: Prepare data and load

Try to perform the following high-level steps to complete this exercise. If you get stuck, go to the step-by-step section and follow those instructions instead.

  1. Open and check the dataset.

  2. If necessary, use the Text to Columns tool of Microsoft Excel to make the data easier to read.

  3. Ensure that the dataset includes all required columns.

  4. Identify the columns that you want to include in the process mining.

  5. Save the dataset as CSV.

  6. Create the process and then load the dataset.

Step by step: Prepare data and load

This section provides more in-depth guidance for the preceding high-level steps.

Task: Review the dataset

To review the dataset, follow these steps:

  1. Locate and open the AP_EV_LAB_Transform.csv file.

    The data in the file should resemble the following image.

    Screenshot of the initial C S V data.

    Note

    A vertical bar (|) separates the data, making it difficult to read. Use the Text to Columns feature of Excel to make the data easier to read.

  2. Select the Data tab.

  3. All data for each row is in one cell. Select all rows, including the header, and then select the Text to Columns tool.

    Screenshot of the Data tab and the Text to Columns button.

  4. Select Delimited and then select Next.

    Screenshot of the Convert Text to Columns Wizard Step one of three.

  5. Select Other, enter the vertical bar (|) character, and then select Next.

    Screenshot of the Convert Text to Columns Wizard Step two of three.

  6. Select Finish.

    The data should now be easier to read.

  7. Check if the required fields are present.

    Screenshot of the required fields.

  8. Identify other fields that you want to map for the process mining.

  9. Optionally, you can take notes on what fields to use. After you finish inspecting the data, select File and then select Save As.

  10. Save the file as CSV format and then give it an appropriate name.

    Screenshot of the file saved in C S V format.

  11. Close the file.

Task: Create the process and load data

In this next task, you create the process and load data by following these steps:

  1. Go to Microsoft Power Automate and select the correct environment.

    Screenshot of the selected environment.

  2. Select Process mining from the left pane and then select + Start here.

    Screenshot of Process mining selected and the Start here button.

  3. Enter Normalize PM for the Process name, select Import Data for the Data source, select Dataflow, and then select Continue.

    Screenshot of the Create a new process wizard with Import data and Dataflow selected.

  4. Select Skip if the system prompts you to add Microsoft Power BI Workspace.

  5. Select Text/CSV as the data source.

    Screenshot of the selected data source as Text C S V.

  6. Select Upload file and then select the Browse button.

    Screenshot of the Upload file option selected and the Browse button.

  7. Select your created CSV file and then select Open.

    Screenshot of the selected C S V file.

  8. If you're not signed in, select the Sign in button and provide your credentials.

  9. Select Next.

    Screenshot of the connection settings.

  10. A preview of the data should display. Select Next.

    Screenshot of the preview data.

    The system should advance you to the Transform stage.

    Screenshot of the transform data stage.

  11. Don't navigate away from this page.

Change the column type and rename

After loading the data into your process, you discover that the data in the Timestamp column should read England (Europe) Date/Time. As a result, you decide to rename the column to Event Start.

High-level steps: Change the column type and rename

Try to perform the following high-level steps to complete this exercise. If you get stuck, go to the step-by-step section and follow those instructions instead.

  1. To change the column type to Date/Time England (Europe), use the Change column type with locale tool from the Power Query Transform tab.

  2. Rename the Timestamp column to Event Start.

Step by step: Change the column type and rename

This section provides more in-depth guidance for the preceding high-level steps.

Task: Change the column type and rename

To change the column type and rename it, follow these steps:

  1. Select the Transform tab.

  2. Select the Timestamp column header and then select the dropdown arrow next to Data type.

    Screenshot of the Timestamp column selected and the data type selected from the Transform tab.

  3. Select Using locale.

    Screenshot of the Using locale data type option.

  4. Select Date/Time for the Data type, select English (Europe) for the Locale, and then select OK.

    Screenshot of the Change column type with locale dialog showing information filled in.

    The Timestamp column should now resemble the following image.

    Screenshot of the Timestamp column values.

  5. Your added step should appear on the Query settings properties. The steps include some that the system adds automatically. Double-click the Changed column type with locale step.

    Screenshot of the Changed column type with locale step.

  6. The Change column type with locale dialog should open. You can edit the step by changing the data type and/or locale. Select Cancel.

    Screenshot of the Cancel button.

  7. You can also delete the step by selecting the X button. Do not delete the step.

    Screenshot of the delete step button.

  8. Double-click the Timestamp column header.

  9. The column name should go into edit mode. Change the column name to Event Start.

    Screenshot of the renamed Event Start column.

The renamed column step should now show as added to the applied steps.

Screenshot of the applied steps.

Filter row

Vendor8 is no longer on the preferred vendors list. After a review, you realize that data that relates to Vendor8 doesn't add value, so you decide to remove all activities associated with Vendor8.

High-level steps: Filter row

Try to perform the following high-level steps to complete this exercise. If you get stuck, go to the step-by-step section and follow those instructions instead.

  1. Locate the vendor column.

  2. Filter out all activities associated with Vendor8.

Step by step: Filter row

This section provides more in-depth guidance for the preceding high-level steps.

Task: Filter rows

To filter the rows, follow these steps:

  1. Select the Transform tab.

  2. Select the Vendor column and then select the dropdown menu next to the column header.

    Screenshot of the dropdown menu next to the Vendor column header.

  3. Locate and clear the Vendor8 checkbox.

    Screenshot of the Vendor 8 checkbox cleared.

  4. Select OK.

  5. The system should now filter out Vendor8 from the dataset. A Filtered rows step should now show in the Applied steps section.

    Screenshot of the Filter rows step added to the Applied steps section.

Replace values rows

While transforming the data, you find that the value OCR isn't clear enough. You decide to replace it with the more descriptive term Object Character Recognition instead.

High-level steps: Replace values rows

Try to perform the following high-level steps to complete this exercise. If you get stuck, go to the step-by-step section and follow those instructions instead.

  1. Use the Replace values feature of Power Query to replace the OCR value of the Resource column with Object Character Recognition.

  2. Use the Replace values feature of Power Query to replace the OCR value of the Resource Name column with Object Character Recognition.

Step by step: Replace values rows

This section provides more in-depth guidance for the preceding high-level steps.

Task: Replace value

To replace the value, follow these steps:

  1. Select the Transform tab.

  2. Select the Resource column. Go to the ribbon, select Replace values, and then select Replace values again.

    Screenshot of the Replace values button.

  3. You can also right-click the Resource column header and then select Replace values.

  4. Select Advanced.

    Screenshot of the Advanced option of the Replace values dialog.

  5. In the Value to find field, enter OCR. Enter Optical Character Recognition in the Replace with field, select the Match entire cell contents checkbox, and then select OK.

    Screenshot of the advanced Replace values dialog.

    The Resource column should now show the OCR value replaced with Optical Character Recognition.

    Screenshot of the replaced resource values.

  6. Right-click the Resource Name column header and then select Replace values.

    Screenshot of the Resource Name column header selected showing the Replace values option.

  7. Select the Advanced option.

  8. In the Value to find field, enter OCR. Enter Optical Character Recognition in the Replace with field, check the Match entire cell contents checkbox, and then select OK.

    The Resource Name column should now show the OCR value replaced with Optical Character Recognition.

    Screenshot of the replaced value in the Resource Name column.

Two Replaced value steps should now show in the Applied steps section.

Screenshot of the Applied steps section showing two Replaced value steps added.

Rename steps

After completing your data transformation, you realize that the step names are too generic. As a result, you decide to rename them to more descriptive names.

High-level steps: Rename steps

Try to perform the following high-level steps to complete this exercise. If you get stuck, go to the step-by-step section and follow those instructions instead.

  1. Use the Rename step feature to rename the Replaced value step to Replace OCR Resource.

  2. Use the Rename step feature to rename the Replaced value 1 step to Replace OCR Resource Name.

  3. Use the Rename step feature to rename the rest of the steps that you previously added.

Step by step: Rename steps

This section provides more in-depth guidance for the preceding high-level steps.

Task: Rename steps

To rename the steps, follow this procedure:

  1. Go to the Applied steps section and right-click the Replaced value step.

  2. Select Rename.

    Screenshot of the Rename option to rename the Replaced value step.

  3. Rename the step to Replace OCR Resource.

  4. The step name is now Replace OCR Resource. Select the Diagram view button.

    Screenshot of the Diagram view button.

  5. A diagram view of the applied steps should display. Right-click the Replaced value 1 step and then select Rename.

    Screenshot of the Rename button to rename the Replaced value 1 step.

  6. Rename the step to Replace OCR Resource Name.

  7. To exit the diagram view, select the Diagram view button again.

    Screenshot of the Diagram view button again.

  8. Expand the Query settings pane.

  9. Optionally, you can rename the rest of the steps that you previously added.

  10. The applied steps should now resemble the following image. Select Next.

    Screenshot of the renamed steps and the next button.

Map attributes

In this final task, you map the required attributes.

  1. Map the required attributes as shown in the following table.

    Attribute name Attribute type
    Case ID Case ID
    Activity Activity
    Event Start Event Start

    Screenshot of the mapped required fields.

  2. Map the rest of the attributes as shown in the following table.

    Attribute name Attribute type
    Resource Resource
    Resource Name Event Level Attribute
    Vendor Case Level Attribute (first event)
    Automation Case Level Attribute (first event)
    Paid on Time Case Level Attribute (first event)
    Reason for Rejection Case Level Attribute (first event)
    Cash Discount % Case Level Attribute (first event)
    Cash Discount Value Financial per Case (first event)
    Invoice Value Financial per Case (first event)
    Business Unit Case Level Attribute (first event)
    Region Case Level Attribute (first event)

    Screenshot of the mapped optional attributes.

  3. Select Save and analyze and then wait for the system to complete the mapping.

The overview of the process should resemble the following image.

Screenshot of the process overview.