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

Introduction to hierarchies in NextTables

What a hierarchy view is, parent-child versus directory, node types, the data node and text nodes, validity and the reference date, and the choices fixed at creation.

You will learn

  • What a hierarchy view is and which tables it creates in your database.
  • How a parent-child hierarchy differs from a hierarchy with a directory, and which one fits your data.
  • What node types, the data node and text nodes are.
  • Which tables and columns land in your database, and how NextTables terms map to SAP terms.
  • How validity periods and the reference date make a hierarchy time-dependent.
  • Which choices are fixed once the hierarchy exists, and what hierarchies don't do yet.

This article is for data platform owners, controllers and application builders who plan a hierarchy before they create it. It explains the concepts and the tables a hierarchy creates; the how-to articles linked below walk through each task. A good reading order is this article, then the creation article for your scenario (directory or parent-child), then maintaining, time-dependent hierarchies, texts and your own fields.

Prerequisites

What a hierarchy view is

A hierarchy view shows data as a tree. Each node sits under a parent, and the tree can be expanded, searched and rearranged by drag and drop. You create a hierarchy view in a folder with Create hierarchy view..., and NextTables creates the tables behind it in the database you pick. The tables are ordinary tables: your data platform reads them like any other table in that database.

Next to the tree, the hierarchy view shows your own fields as columns, for example an owner or a planning value per node. You edit them inline, the same way you edit cells in a grid view.

A profit center hierarchy in NextTables with regions as text nodes, profit centers below them, the hierarchy switch, the reference date and an Owner column

Parent-child or directory: which scenario to choose

When you create a hierarchy view, you pick one of two scenarios. The choice is fixed once the view exists.

Diagram comparing the two scenarios: parent-child, where cost center 10001600 names 10001100 as its parent in the same table, and directory, with the hierarchies PC-2026 and PC-2027 and the text node EMEA above the profit center 100010

Parent-childDirectory
In the product"One table where each row links a node to its parent""Several hierarchies and node types in one place"
Tables createdOne tableA structure table, a directory table and, when you use text nodes, a text nodes table
Hierarchies per viewOne, named after the viewAs many as you add to the directory
Kinds of nodeAll nodes are identified by the same fieldsSeveral node types, each identified by its own fields, plus optional text nodes
ValidityOptional, on the tableOptional, chosen per table
Language textsNoOptional, on the text nodes table
Good fit forOne tree where group nodes are values of the same fields as the leaves, for example an organization chart or groups kept in the cost center column itselfSeveral named hierarchies of the same kind, mixed levels such as group nodes above cost centers, and tables on which a hierarchy with directory can be modeled in SAP Datasphere

The steps for each are in How to create a parent-child hierarchy in NextTables and How to create a hierarchy with a directory.

Nodes, node types and the data node

In a parent-child hierarchy, every row of the table is a node. The identifying fields you define, for example a cost center, name the node, and a matching set of parent fields names its parent. A row whose parent fields are empty is a root. Any node can have children, so group nodes are values of the same fields as the leaves. If your groups are separate master data, such as cost center groups, use a hierarchy with a directory.

In a hierarchy with a directory, you define node types. Each node type has a Node type value, a Node name and its own identifying fields:

  • Data node: exactly one node type is the data node, "the node type that holds your data", for example the cost center. Data nodes are the leaves of the tree and can't have children.
  • Nodes identified by a key: any other node type with identifying fields, for example a cost center group that exists as master data. These nodes can have children.
  • Text node: at most one node type can be the text node. A text node "groups other nodes; its name comes from the text nodes table". You give it a Node ID, and its label comes from the text nodes table, optionally per language.

💡 Tip: Use a text node for a grouping level that has no master data of its own, for example "Sales regions" above your profit centers. Use a node type with a key for a grouping level that already exists as master data, for example profit center groups.

Each node shows its name: the text of the master data object bound to its identifying fields, or the text from the text nodes table. Without either, the tree shows the key or the Node ID.

Validity and the reference date

Each table of a hierarchy can include validity: a Valid from and a Valid to field. Both dates count as part of the period, and an empty Valid to means the row has no end date. If a reporting tool filters by key date, keep Valid to required and use December 31, 9999 for an open end, as new nodes do. With validity, one node can sit under different parents in different periods, for example after a reorganization at the start of a fiscal year.

A hierarchy view with validity has a Reference date in its toolbar. It starts at today, and the tree shows the rows valid on that date. Change it to see the hierarchy as it was, or as it will be. In a directory, each hierarchy can also have its own validity, and the hierarchy switch groups them into "Valid on" the reference date and "Not valid on this date".

To keep a new version of a hierarchy, for example for the next fiscal year, add it to the directory as a new hierarchy with its own Hierarchy ID, such as ORG-2027 next to ORG-2026, and give each its own validity. Details are in How to work with time-dependent hierarchies.

What lands in your database

NextTables creates ordinary tables in the database you pick. The default column names below can be changed in the last steps of the wizard.

Diagram of the data flow: the profit center hierarchy maintained in a NextTables hierarchy view is written into a structure table, a directory table and a text nodes table in your database, which SAP Datasphere uses as a hierarchy with directory and Databricks or PostgreSQL read with a recursive query

TableColumnsKey
Parent-child tableYour identifying fields (the node), the matching parent fields, SORT_ORDER*, VALID_FROM and VALID_TO*, your own fieldsIdentifying fields (+ VALID_FROM)
<prefix>_STRUCTUREHIERARCHY_ID, NODE_ID, PARENT_ID, NODE_TYPE, the key columns of each node type with a key (filled only on rows of that type), SORT_ORDER*, VALID_FROM and VALID_TO*, your own fieldsHIERARCHY_ID + NODE_TYPE + NODE_ID (+ VALID_FROM)
<prefix>_DIRECTORYHIERARCHY_ID, NAME, VALID_FROM and VALID_TO*, your own fieldsHIERARCHY_ID (+ VALID_FROM)
<prefix>_TEXT_NODESNODE_ID, LANGUAGE*, TEXT, VALID_FROM and VALID_TO*, your own fieldsNODE_ID (+ LANGUAGE) (+ VALID_FROM)

* Only when switched on in the wizard.

  • A root has empty parent fields. If other tools load rows into the table, write NULL for a root's parent rather than an empty string.
  • For a node with a key, NextTables generates its NODE_ID and keeps it in every period; the node's key is stored in its node type's own columns. For a text node, NODE_ID is the Node ID you type.
  • PARENT_ID always holds the parent's NODE_ID.
  • Texts are keyed by NODE_ID and belong to no single hierarchy, so every hierarchy that uses a Node ID shares its texts.
  • SORT_ORDER is a whole number that orders the children of one parent, in steps of 100. Tools that read the tables sort by it themselves.

How the tables are used on your data platform

NextTables creates tables and leaves the semantic modeling to your data platform. In SAP Datasphere, the tables can be used as follows:

NextTables tableCan be used in SAP Datasphere as
Directory tableThe directory of a hierarchy with directory
Structure tableA hierarchy with directory, with HIERARCHY_ID, NODE_ID, PARENT_ID and NODE_TYPE, and each node type's key column associated with its dimension
Text nodes tableA text entity for the text nodes, with LANGUAGE as the language column
Parent-child tableA parent-child hierarchy on the dimension of the identifying fields

Databricks and PostgreSQL have no hierarchy object of their own: a recursive query over the node and parent columns reads the tree. For reading NextTables tables in SAP Datasphere in general, see How to consume NextTables data in SAP Datasphere.

NextTables terms and their SAP counterparts

NextTablesSAP counterpart
Data nodeLeaf node type: the members of the dimension (SAP BW: the characteristic values)
Node type with a keyNode type associated with its own dimension (SAP BW: external characteristic node)
Text nodeText node (SAP BW: 0HIER_NODE)
Node type valueValue in the NODE_TYPE column
Hierarchy IDHierarchy name in the hierarchy directory
Reference dateKey date
Valid from / Valid toDATEFROM / DATETO, both dates included
A new version of a hierarchyA new hierarchy with its own Hierarchy ID

What is fixed once the hierarchy exists

⚠️ Caution: Decide these before you select Create hierarchy. They can't be changed afterwards:

  • The scenario: parent-child or directory.
  • The identifying fields, the parent and child fields, and the database.
  • Include sort order: without a sort order, nodes can be moved to another parent but can't be reordered among their siblings.
  • Include validity, per table.
  • Which node type is the data node, once the hierarchy has nodes, and which node type is the text node.

You can still add your own fields, add, rename or remove node types, and change everything inside the hierarchy itself. See How to add your own fields to a hierarchy.

Who can do what

A hierarchy view uses the same view permissions as a grid view.

TaskPermission
Create a hierarchy viewCreate table on the folder
Browse and search the treeView data
Add nodes, add hierarchies, add textsAdd data
Move nodes, edit fields, edit hierarchies and textsEdit data
Delete nodes and textsDelete data
Delete a whole hierarchy, or more than 30 rows at onceDelete all
Change node types and fieldsEdit table

What hierarchies don't do yet

  • Row-level security and filters can't be configured for a hierarchy view. Their entries in View settings are greyed out.
  • A hierarchy view can't be transported. A transport package that contains one is refused on import.
  • Fields in other views can't pick their values from a hierarchy yet.
  • On a given date, each node sits under exactly one parent. Link nodes (the same node under several parents) and intervals (a range of leaf values under one node, as in SAP BW) are not supported.
  • Nodes without a parent on the reference date are not shown in the tree. A notice above the tree says how many there are. They stay in the tables, where SAP Datasphere, SAP Analytics Cloud and other tools handle them by their own rules, so resolve them before the hierarchy is used in reports.

Troubleshooting / FAQs

1. Where do I find Create hierarchy view?

Open the menu of a folder in the views sidebar, or the menu next to Views at the top of the sidebar, and select Create hierarchy view.... If the entry is missing, your role lacks the Create table permission on that folder.

2. Can I turn an existing table into a hierarchy view?

No. A hierarchy view always creates its own tables in the database you pick.

3. How does my data platform read the hierarchy?

The hierarchy is stored in ordinary tables of your database, described above under "What lands in your database". A hierarchy with directory can be modeled on them in SAP Datasphere; on Databricks and PostgreSQL, a recursive query reads the tree.

4. I need sort order or validity, but I didn't include it.

Both can only be chosen when the hierarchy is created. Create a new hierarchy view with the option switched on and load the data into it.

5. For which systems can I maintain hierarchies with drag and drop?

Hierarchies work on SAP Datasphere, Databricks and PostgreSQL. Snowflake, Microsoft Fabric and Dremio are on the roadmap.

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.