Skip to content
  • There are no suggestions because the search field is empty.

How to create a parent-child hierarchy in NextTables

The Create hierarchy view wizard for a parent-child hierarchy, step by step, on a cost center example.

You will learn

  • How to start the wizard that creates a hierarchy view.
  • How to define the fields that identify each node, with master data for readable names.
  • How the parent and child fields, sort order and validity are set up.
  • How to add your own fields and create the hierarchy.

This article is for data platform owners and application builders who set up a hierarchy for others to maintain. The example is a cost center hierarchy whose group nodes are kept in the cost center column itself, so every node is identified by the same fields. If your groups are separate master data, such as cost center groups, use a hierarchy with a directory instead.

Prerequisites

Step-by-Step Instructions

1) Start the wizard

  • In the views sidebar, open the menu of the folder that will hold the hierarchy.
  • Select Create hierarchy view....
  • The dialog Create hierarchy view in your folder opens on step 1 Set up hierarchy.

The menu of a folder in the views sidebar with the entry Create hierarchy view highlighted

Step 1 of the Create hierarchy view wizard with the database, the business name Cost center hierarchy and the Parent-child scenario selected

2) Set up the hierarchy

  • Database: pick the database. "All tables are created in this database."
  • Business name: enter the name users see, for example Cost center hierarchy. It must be unique in the top-level folder.
  • Scenario: select Parent-child, "One table where each row links a node to its parent".
  • Select Next.

📝 Note: Changing the database or the scenario later in the wizard clears your entries in steps 2, 3 and 4. After the hierarchy is created, neither can be changed.

3) Identify the nodes

In step 2 Identify nodes, define the Identifying fields: the "fields that together identify each node, in this order".

  • For each field, enter a Field name (the label users see), a Column name (the column in your database) and a Data type.
  • Pick a Masterdata object to show names instead of codes, for example Cost center. If the master data object has a compound key, its other key fields are added for you and marked Added by that object.
  • Use Add field for a second identifying field, for example a controlling area, and drag the rows into the right order.

Step 2 Identify nodes with the master data object Cost centers, which adds controlling area, cost center and company code as identifying fields

4) Check the parent and child fields

Step 3 Add fields shows the Parent and child fields, "created from your identifying fields, in the same order. Parent fields link each node to its parent, child fields identify it."

  • Enter the Technical name of the table in your database.
  • Adjust the field and column names of the parent and child fields if your naming convention needs it.
  • At least one child field must stay required. A row whose parent fields are empty is a root of the tree.

5) Choose sort order and validity

Under Optional fields, switch on Include for what you need:

  • Sort order: lets users reorder nodes among their siblings by drag and drop. Without it, nodes can still move to another parent.
  • Validity (the Valid from row): adds Valid from and Valid to, so a node can sit under different parents in different periods. Valid from is always required. Valid to is required by default and can be made optional. Keep it required if a reporting tool filters by key date, and use December 31, 9999 for an open end.

⚠️ Caution: Sort order and validity can't be added after the hierarchy is created. If you might need either, switch it on now.

Step 3 Add fields with the parent and child fields, sort order and validity switched on under Optional fields, and an Owner field under Other fields

6) Add your own fields

  • Under Other fields, "add your own fields to keep more about each node", for example Owner as text or Budget as a decimal.
  • Each field can have a master data object and can be required.
  • Fields can also be added after creation. See How to add your own fields to a hierarchy.

7) Review and create

  • Step 4 Review and create lists the table, its fields and what is "Not included".
  • Select Create hierarchy. The table is created and the new hierarchy view opens, empty.
  • Add the first node with Add node. See How to maintain a hierarchy in NextTables.

Troubleshooting / FAQs

1. The Next button stays disabled in step 1.

The business name is either empty or already used by another hierarchy view in the same top-level folder. Enter a different name.

2. I can't pick Chips or Stars as the data type of an identifying field.

Identifying fields, parent fields and child fields hold keys, so those display types are not offered there. Use them for your own fields under Other fields.

3. I closed the wizard by mistake.

Closing asks "Exit hierarchy creation?". If you select Exit without saving, nothing is created and your entries are discarded. Start again with Create hierarchy view....

4. The hierarchy was created but didn't open.

The message "The hierarchy was created, but it could not be opened" means the tables exist. Reload the page and open the view from the sidebar.

Still need help?

Customers open a support ticket and follow every reply in the Support Portal. Subscribe to product updates and the release notes reach you by email.

Evaluating NextTables? Talk to the team that builds it.