Data Structure for Wide Group Views
Last updated
Was this helpful?
Last updated
Was this helpful?
This document explains the process to dynamically convert a standard data structure to the data structure required to plot a wide group view in the xViz Performance Flow visual
Prerequisite - Before proceeding with this page, please go through the following pages to ensure a comprehensive understanding of the configurations required:
Let’s explore this with an example of Warehouse Management. We have a dataset with specific IDs, but we don't have the Parent ID, Group ID, and Subtree ID included. However, we can easily create these columns in Power Query using a few transformation steps.
We have a Source table with the columns Id, Racks, Section, and City.
This will result in a new column named "Text After Delimiter", where the section category is displayed, as shown in the image below:
We will now create a function to retrieve the number of vertical racks for each section based on the Warehouse Section column. Copy the code below and paste it into the Advanced Editor after the final step:
Make sure to replace the "Warehouse Section" text with the name of your grouping column.
This will result in a new column named "Sub Tree Id" is displayed in the image below:
This will result in a new column named "Parent Id", displayed in the image below:
This will result in a blank column named "Group Id" is displayed in the image below:
We will now perform basic transformations, such as changing data types and reordering columns, as shown in the image below:
Now, we will create a static table to define the groups in the visual.
Enter the same values in both the Group Id and Id columns which we got in Subtree Id during transformation.
Then, add the Section Names to the Racks column to create a suitable structure for swim lanes, leaving the remaining columns blank.
Our data structure is now ready!
Finally, populate the data columns in the visual to display the data in Groups, as shown in the image below:
This example is inspired by common, real-life dataset structures. Your source data structure may vary and may require additional data transformations to align with this example.
We can now extract the Section Column using the . The delimiter in this dataset is the hyphen (-)
Let's create a "Warehouse Section" column that will be the group for the nodes. We will - City and Category with a hyphen (-) as the separator. Name the column as "Warehouse Section"
Now, we define a variable that sets the number of vertical racks in each section. Simply copy the code below and paste it into the after the Merged Columns step.
Add an Index column starting from 1 -
We will now add the "Subtree Id" column - Create a Custom Column - paste the code below as its definition and name the column as "Subtree Id"
Then, we will add the "Parent Id" column - Create a Custom Column - paste the code below as its definition and name the column as "PId":
Now, we will add the "Group Id" column- Create a Custom Column. Then enter double quotes in the custom formula tab to create a blank column for now. Name this column as "Group Id":
Click on "Enter Data" in the Home tab of Power Query Editor and input the data -
Finally, we will append the Static Groups table to the Source table -