Skip to Content
Technical Articles

List the members of a dimension in a dropdown and filter table according to this dimension member – SAP Analytics Cloud

Suppose we want to list the members of a dimension in the click of a dropdown in SAP Analytics Cloud (SAC). Is it possible to do that in SAC? If yes, How can we do this?

The answer is yes we can do this. How? We will see this in this blog post.

The second query is to filter a table according to the dimension member selected.

We can fill in the members of a dimension inside a dropdown and filter a table according to the selected dimension member using scripting in SAP Analytics Cloud.

Scripting in SAP Analytics Cloud

Scripting in SAP Analytics Cloud is possible only in Analytic Application in SAP Analytics Cloud. Scripting in SAP Analytics Cloud is a vast topic. Here we are only covering the scripting required for the topics mentioned in the blog post.

Step 1: Creating an Analytic Application : Click Create >> Click Analytic Application

Creating%20an%20Analytic%20Application

Step 2 : Add the Widgets Drop Down and Table to the canvas

Analytic%20Application%20Initial%20Screen

Analytic Application Layout

Analytic%20Application%20Canvas%20After%20adding%20Table%20and%20Dropdown

Analytic Application Canvas After adding Table and Dropdown

Step 3: While hovering above canvas, Click on fx to write script on initialization of the application so that we can load all members of dimension in the dropdown on initialization of the application.

 

Let’s see the Sample Code:

Sample%20Code

Sample Code

After saving this code and clicking the button Run Analytic Application, Members of the particular dimension will be listed in the Dropdown. Here I have listed all members in the Dimension Bike.

Now let’s add the dimensions in the Table and Label to the Dropdown.

Here we haven’t used any styling. You can add it as your requirement.

Our next requirement is to filter the table according to the selected member in the dropdown. i.e here, if we select Bike A in dropdown, the table should be filtered with Bike Type Bike A.

Step 4: While hovering above Dropdown_1, Click on fx to write script onSelect().

 

Let’s see the Sample Code:

Sample%20Code

Sample Code

Now click on Run Analytic Application, you will find all our requirements satisfied.

Conclusion:

Scripting in SAP Analytics Cloud is a vast topic. Here we have only covered the scripting required for the topics mentioned in the blog post. Hope all of you got a better understanding about the content mentioned in blog post. Please feel free to shoot out any mistakes in the blog post through your valuable comments.

Be the first to leave a comment
You must be Logged on to comment or reply to a post.