Data Structure
The visual supports two kinds of hierarchical structures:
1. Id and Parent Id columns
The hierarchy can be established by having the parent-child relationships defined for every row of data. For example: An organization data, a row of data can correspond to an employee in the company.
We need two columns to establish the parent-child relationships:
1. Each of these rows must have a unique identifier column, like the Employee Id.
2. Another column must contain the parent row’s identifier column, like the Manager Id.
The ‘Hierarchy Field’ data field must be populated with the Id column, while the ‘Parent field’ must be populated with the Parent Id column.
![](https://docs.xviz.com/~gitbook/image?url=https%3A%2F%2F382510089-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FIuuIZWiXEx25eV75hmmJ%252Fuploads%252F5mX1ZJiZ7qCnDgHqJIWO%252Fimage.png%3Falt%3Dmedia%26token%3D9495b742-a108-4082-897e-4a7d45f85e31&width=768&dpr=4&quality=100&sign=bb32272f&sv=1)
The visual now has the hierarchy structure displayed on the canvas:
![](https://docs.xviz.com/~gitbook/image?url=https%3A%2F%2F382510089-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FIuuIZWiXEx25eV75hmmJ%252Fuploads%252FCHdQsWq98efr5cTL3pmP%252Fimage.png%3Falt%3Dmedia%26token%3Def94484f-2c69-4b8c-a8ed-1906db210945&width=768&dpr=4&quality=100&sign=f8aaaeea&sv=1)
Note: The Id and PId columns can also be name columns (like Employee Name and Manager Name respectively). Since Name uniqueness cannot be guaranteed, we recommend using unique Id columns like Index columns.
2. Multiple Category Columns
Provide multiple Category Columns in the ‘Hierarchy Field’ to set the hierarchy for the visual, as shown below:
![](https://docs.xviz.com/~gitbook/image?url=https%3A%2F%2F382510089-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FIuuIZWiXEx25eV75hmmJ%252Fuploads%252FGfv24jek6lpLlRov3IV5%252Fimage.png%3Falt%3Dmedia%26token%3D557bb23d-d772-417c-a06d-1b86bc1ac20e&width=768&dpr=4&quality=100&sign=e5d10c0&sv=1)
The values in the leaf level will be picked from the data model. Aggregations for the higher levels will be done within the visual.
Aggregation options are available as follows:
![](https://docs.xviz.com/~gitbook/image?url=https%3A%2F%2F382510089-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FIuuIZWiXEx25eV75hmmJ%252Fuploads%252F7e7v0s3NNOQUCNqhcQtg%252Fimage.png%3Falt%3Dmedia%26token%3Da8cd5401-19cc-42c0-b939-10e70f96ffcd&width=768&dpr=4&quality=100&sign=47fb4903&sv=1)
Enable ‘Total’ node as the root node for a grand total.
The hierarchy will be plotted as shown below:
![](https://docs.xviz.com/~gitbook/image?url=https%3A%2F%2F382510089-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FIuuIZWiXEx25eV75hmmJ%252Fuploads%252FFvbwS6FzDWPe1Y7Nw5uJ%252Fimage.png%3Falt%3Dmedia%26token%3Db65e0e84-53b7-4d80-a39f-6b83cb0cef21&width=768&dpr=4&quality=100&sign=3951ae37&sv=1)
Last updated