How to create a hierarchy with a directory
The Create hierarchy view wizard for a hierarchy with a directory, on a profit center example with regions as text nodes, plus changing node types later.
You will learn
- How to set up a hierarchy view that holds several hierarchies in one directory.
- How to define node types, pick the data node and add a text node for grouping levels.
- How the structure, directory and text nodes tables are created, with validity and language where you need them.
- How to add, edit and delete the hierarchies of the directory.
- How to change node types after the hierarchy exists.
This article is for data platform owners and application builders who set up a hierarchy for controllers and data stewards. The example is a profit center hierarchy: regions as text nodes above profit centers, with one hierarchy per fiscal year.
Prerequisites
- The Create table permission on the folder.
- A database connection that NextTables can write to and that the folder may use.
- Optional: master data objects for the node types identified by a key, for example profit centers.
- The concepts in Introduction to hierarchies in NextTables, in particular node types, the data node and text nodes.
Step-by-Step Instructions
1) Start the wizard and pick the directory scenario
- In the views sidebar, open the menu of the folder and select Create hierarchy view....

- Pick the Database and enter a Business name, for example Profit center hierarchy.
- Under Scenario, select Directory, "Several hierarchies and node types in one place". The scenario can't be changed later.
- Select Next.
2) Add the node types
In step 2 Identify nodes, "add each node type and pick the data node". For each node type:
- Node type value: the value stored in the Node type column, for example PC or REGION. Each value must be unique.
- Node name: the name users see, for example Profit center or Region.
- Identifying fields: the fields that identify a node of this type, with an optional Masterdata object, for example the profit center with its master data.
Then mark the roles:
- Select Data node on the node type that holds your data, here the profit center. Data nodes are the leaves of the tree. Exactly one node type is the data node.
- Tick Text node on a grouping level that has no master data, here the region. Its nodes get a Node ID and their names come from the text nodes table. Only one node type can be the text node, and the data node can't be one.

💡 Tip: A grouping level that exists as master data, such as profit center groups, works better as its own node type with identifying fields. Its names then come from that master data, and nobody maintains them twice.
3) Set up the tables
Step 3 Add fields lists the new tables on the left. Enter a Prefix, which "starts every table name", and check each table:
- Structure table: "one row per node, linked to its parent". It always gets Hierarchy, Node, Parent, Node type and the identifying fields of every node type. Under Optional fields, switch on Include for the sort order and the validity if you need them.
- Directory table: "one row per hierarchy, with its name". Each hierarchy gets an ID and a name. "Switch on validity if each hierarchy is valid for a period", for example one hierarchy per fiscal year.
- Text nodes table: "one row per text node label", created because a node type is a text node. Switch on Include for the language for texts in several languages, and validity if the labels change over time.
- Under Other fields on each table, add your own fields, for example an Owner on the structure table or a Responsible team on the directory table.

⚠️ Caution: Sort order, validity and language can't be added after the hierarchy is created, and fields added later go to the structure table only. Decide on the directory and text nodes fields now.
If a table you are not looking at has a problem, a message names it, for example "The Directory table has validation errors."
4) Review and create
- Step 4 Review and create summarizes the node types and every table.
- Select Create hierarchy. The tables are created and the hierarchy view opens.
- The directory is empty at first. Add the first hierarchy as described in the next step.
5) Manage the hierarchies of the directory
- In the Hierarchy switch of the toolbar, select Add hierarchy. The form is "Saved to the directory table".
- Enter the Hierarchy ID and the Name, for example PC-2026 and Profit centers 2026, and its validity if the directory table has one. Each Hierarchy ID exists once in the directory; an ID that is already used is refused with "A hierarchy with this key already exists."
- Select Edit hierarchy next to a hierarchy in the switch to change its name, validity or your own fields. The Hierarchy ID can't be changed.
- Select Delete hierarchy, then Delete rows, to remove a hierarchy. "The hierarchy and its rows will be permanently deleted, in every period." The row count includes the hierarchy's row in the directory. Above 30 rows, type delete to confirm. This needs Delete all.
- Large deletes run in the background, and the view is locked until they finish. Other hierarchies and the texts of text nodes stay.

To keep one hierarchy per fiscal year, see How to work with time-dependent hierarchies. To add nodes, see How to maintain a hierarchy in NextTables.
6) Change node types later
- Open View settings and select Node types, where you can "add, rename, or remove the node types of this hierarchy". This needs the Edit table permission.
- Change the Name of a node type. Its Node type value stays as it is, because rows store it.
- Each node type shows how many rows use it under Used by.
- Select Add node type for a new level. A new node type identified by a key gets its fields added to the structure table when you save.
- A node type that nodes still use can't be removed. When you remove an unused one, its identifying fields stay in the hierarchy as ordinary fields with their values.
- Once the hierarchy has nodes, the data node can't change, and the text node setting can't be changed after a node type is created.

Troubleshooting / FAQs
1. I can't tick Text node on a node type.
Either another node type is already the text node, or this node type is the data node. Only one node type can be the text node, and the data node can't be one.
2. Where are the hierarchy, node and parent columns in step 2?
They are added for every directory hierarchy. The summary in step 2 says "Also added: Hierarchy, Node, Parent, and Node type", and step 3 shows them in the structure table.
3. Which table names will my data platform see?
The prefix plus the table, for example PC_HIER_STRUCTURE, PC_HIER_DIRECTORY and PC_HIER_TEXT_NODES. You can change each Technical name in step 3 before you create the hierarchy.
4. The hierarchy view opens with "Looks like there are no hierarchies yet".
The directory is empty. Select Add hierarchy to create the first one, then add its nodes.


