✆ UAE: +971 58 5616 616, ✆ USA:+14099168409,   ✉ info@insightcubes.com

Using the getHierarchies() and setHierarchy() APIs with SAP Analytics Designer

How to use the getHierarchies() and setHierarchy() APIs with SAP Analytics Designer

In this blog post, we will give a comprehensive example of using the getHierarchies() and setHierarchy() APIs with SAP Analytics Designer.
The getHierarchies() API is used to return the description and ID of all hierarchies of the dimension. While the setHierarchy() is used to set the hierarchy on the dimension.

In this example we will be using the cascading filter process; as in filtering on dimensions and then filtering according to hierarchies to choose how to display the data.

We will add two Dropdown Lists, one for filtering Dimension and the other for filtering Hierarchies, and depending on what Dimension we choose to filter on, the Dropdown List for the Hierarchies filters will change.

There is always one consistent filter for Hierarchies which is Flat Presentation and according to our chosen Dimension, we might either only have that one or have more options.

For example, if we are filtering on Account, we have two choices for Hierarchies; Flat Presentation and hierarchical. When selecting Flat Presentation the selected member will be listed without its descendants, if any. As for hierarchical, if the member is a parent, the descendants will be listed.

The different filters can be chosen by simply selecting them from the Dropdown lists we added.

First, add a table widget to your analytics application. From the builder panel, add the account dimension to the Rows, and the Version dimension to the Columns. Filter the account and version dimensions to balance sheet, and actual respectively. Note this analytics application example is using a planning-enabled model. Hence, the table widget is planning enabled.

Table details

Now add two drop-downs, the first for the dimensions, and the second for the hierarchy.


Create a Script Variable, call it currentDimension, Type string, and the Default Value Entity.

Fill the Dimension dropdown through the builder as follows:

And add the following code to the Dimension dropdown’s onSelect fx

Add the following code to the Hierarchy dropdown’s onSelect fx:

Then add all the on Initialize code

There you have it – you are now able to properly use the getHierarchies() API with SAP Analytics Designer.

Recent Posts

Audit Trail Configuration Toolkit

Audit Trail Configuration Toolkit Audit Trail Configuration Toolkit provides a comprehensive set of tools and resources to help developers easily configure the behavior of the

Scope Configuration Toolkit

Scope Configuration Toolkit With our Scope Configuration Toolkit, you can take control of your consolidation scopes with confidence and precision. This interface makes it extremely

SAP Analytics Cloud Calendar

SAP Analytics Cloud Calendar Features and API’s Workflow Organization (Calendar) Use the SAP Analytics Cloud calendar to organize your workflows with calendar events: You can

SAP Analytics Cloud Data Connections

Live connection (Online) and Import connection (batch) with SAP Analytics Cloud SAP Analytics Cloud enables access to on-premise and cloud data sources using two main

Get in Touch

Learn more and ask us About Our Cloud Consolidation Solution

Share This Post

Share this Page!

Share this with your network.

Want to Know More?

Get In Touch

Something isn’t Clear?

Feel free to contact us, and we will be more than happy to answer all of your questions.