✆ 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.

Dropdowns

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

Switch Themes in SAP Analytics Cloud

By leveraging the power of Theme Builder and integrating JavaScript and CSS, users can seamlessly tailor their dashboards’ appearance to align with specific brand guidelines and aesthetic preferences.

Ownership interface of the consolidation solution for SAP analytics cloud

Managing Ownership Structure

Explore how Consolidation Extension for SAC simplifies managing ownership structures, spanning from creating and editing scopes to assigning ownership methods and percentages for accurate consolidation.

Systems Check and Referential Integrity Interface

Learn how SAP Analytics Cloud’s Consolidation Extension ensures data accuracy with system checks and referential integrity, ensuring proper configuration and identifying inconsistencies in design.

account configuration guide for the consolidation extension

Account Configuration Guide

Detailed guide with automated checks and inconsistencies identification on account configure for automated eliminations, cascading behavior, currency conversions and other rules

Configuration Starter Kit

Summary of all the features and automated system integrity rules included in identifying issues with designs covering scope, currency, account, audit, flow and other dimensions

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.