<< Click to Display Table of Contents >> Auto Loop |
There is a hierarchical relationship among the departments of each company. Each department has a unique department ID. For example: headquarter (ID: 1), technology department (ID: 11, the first digit of the layer is the ID of the first layer), technology engineer (ID: 111, the first digit of the layer is the ID of the first layer and the second digit is the ID of the second layer). The technology department is subordinate to the headquarters. The technology engineer is subordinate to the technology department. When database stores department information, all department IDs are placed in one data column, rather than taking the headquarter as a data column and taking the technology department as another data column. During data analytics, if you need to display the hierarchical relationship among all departments and display data of groups according to the hierarchical relationship, it is impossible to group data through directly adding dimensions.
Auto Loop refers to the column identified the hierarchical relationship automatically according to the setting value. Only one Auto Loop can be created for each data set. Generally speaking, IDs with hierarchical relationship can be stored in inconsistent ID length or consistent ID length. This product specifies that in order to keep the ID length consistent, 0 should be used to make up the position.
For example:
1. For a new Self-Service Data Set, use a SQL Query as an input node which is as shown below:
2. Connect an Auto Loop node behind the input node. In the "Auto Loop" dialog, set Setting to "According to One Column" and Hierarchy Length to "1", as shown in the following figure.
[Setting] Select the number of layered columns: Perform hierarchy based on one or two data columns.
[Hierarchy Length] The number of digits in ID representing a hierarchy.
[ID & Parent ID] Parent ID is the upper layer ID of ID. Only the measure column is displayed here. If According to One Column is selected, layer data according to the hierarchy length and the column corresponding to the ID. If According to Two Columns is selected, layer data according to the ID and parent ID.
[Hierarchy column] Column to be layered.
3. Click "OK." The newly created Auto Loop is a hierarchy column. Since it is an intermediate node, no folder is generated in the hierarchy column, as shown in the following figure.