Blogs / SAP / SAP Analytics Cloud / Application Design / SAP Analytics Cloud – Application Design Series 16 What-If Analysis using Slider and Range Slider

SAP Analytics Cloud – Application Design Series 16 What-If Analysis using Slider and Range Slider

Oct 17, 2019

SHARE

In the previous blog in this series, we learned about Script Objects. In this blog, let us look at the Slider and Range Slider Widgets that can even be used as measure filters in an analytic application.

* * *

The slider can be used by the end-user to dynamically change a number while Range Slider allows them to select a range using two-way slider. You can only map numbers to both the widgets.

Slider & Range Slider Widgets in Action

Here the Slider is used by the end user to change the discount percentage which is then used to calculate Sales, Profit/Loss value and percentage to simulate different what-if scenarios.

SAP Analytics Cloud – Application Design Series 16 What-If Analysis using Slider and Range Slider
Slider Widget

Here the Range Slider is used to filter the Stores that has Gross Margin within the range selected.

SAP Analytics Cloud – Application Design Series 16 What-If Analysis using Slider and Range Slider

Add and Configure Slider Widget

Insert a Slider widget and configure it in the Builder Panel.

SAP Analytics Cloud – Application Design Series 16 What-If Analysis using Slider and Range Slider
Slider Widget Configuration
  • Min Value and Maximum Value defines the upper and lower limit.
  • Current Value is the default value on application start up.
  • Step Size – Minimum increase/decrease when you drag the slider. For step size 1, the possible values are 0, 1, 2, 3… For step size 5, possible values are 0, 5, 10, 15…
  • Enable Value Input so that the user can double click on the slider handle and manually enter the value.
SAP Analytics Cloud – Application Design Series 16 What-If Analysis using Slider and Range Slider

Link Script Variable in Calculated Measure

Create a script variable of type Number. Then in the onChange event of Slider Widget assign the selected value of the Slider to the script variable. Here Discount is the script variable in which the getValue() is used to assign the selected integer.

SAP Analytics Cloud – Application Design Series 16 What-If Analysis using Slider and Range Slider
Slider onChange event script

Now use the script variable Discount in Calculated Measures so that the values change dynamically.

SAP Analytics Cloud – Application Design Series 16 What-If Analysis using Slider and Range Slider
Calculated measure using script variable

Add and Configure Range Slider Widget

Insert and configure the Range Slider.

SAP Analytics Cloud – Application Design Series 16 What-If Analysis using Slider and Range Slider
Range Slider Configuration

In Range Slider default start and end value can be configured. In both the widgets, step size can be a fraction too.

Add Hidden Table and Script to Filter Stores

Add the following script in the onChange event of the Range Slider.

SAP Analytics Cloud – Application Design Series 16 What-If Analysis using Slider and Range Slider
Range Slider onChange event script

Here in the script getData() function is used to get the Gross Margin of each Store and then the Stores that has values within the range is filtered. Since you need to check the values for all the Stores without the influence of filters, add a Table and hide it. This hidden table(Table_Hidden) can be used to check the values of each Store. The stores with Gross Margin within the range is assigned to a local array variable(filtered_stores) which is then used to filter the table(Table_Main) that is visible to the end user.

Slider and Range Slider can also be used to filter dimensions that are numbers(years, months, bottle pack, etc.) filter measure values, dynamic calculations or script logics.

***

Reach out to us here today if you are interested in evaluating if SAP Analytics Cloud is right for you. To know about the Analytic Applications of SAP Analytics Cloud, please check out our blog series here.


Corporate HQ:
5920 Windhaven Pkwy, Plano, TX 75093

+1 888-227-2794

+1 972-232-2233

+1 888-227-7192

solutions@visualbi.com


Copyright © Visual BI Solutions Inc.

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Join our mailing list to receive the latest news and updates from our team.

You have Successfully Subscribed!

Share This!

Share this with your friends and colleagues!