Skip to Content
Technical Articles
Author's profile photo Sreemoyee Mallick

Parameter passing in SAC Analytics Designer

In this blog post, I will provide a step-by-step process to pass user selected multiple dynamic data values as story filters from SAC Analytics Designer to Story. 

To demonstrate this, we have 2 cases:

  1. USE CASE 1 Overview: Choose a model used in the story, any dimension from that model and any number of the members of the dimension selected and pass your selection to the story as story filter ( also mention if you want to include/exclude your selected members).

USE%20CASE%201%20demo%20in%20analytics%20designer

USE CASE 1 demo in analytics designer

STEPS WITH SCRIPTS AND EXPLANATIONS:

 Let us say, we select Business_Unit from the list of dimensions, then the checkbox gets populated with the members of the selected dimension i.e., Business_Unit, we can select the desired members and provide input as y/n (include/exclude the selected members). On clicking the button “Passing the value selected as story filter”, a story opens with our selections as the story filter. In this case, the story has excluded the Business_units A and B, and it has a story-defined story filter Company_Code.

Actions:

a) Choose a dimension from the dropdown (say Business_Unit). Checkbox gets auto-filled with the members of the selected dimension.Select%20a%20dimension%20from%20dropdown

Select a dimension from dropdown

b) Select the members of the dimension from the checkbox (say A and B).Select%20desired%20dimension%20values%20from%20the%20checkbox

Select desired dimension values from the checkbox

c) Mention Y/N to include/exclude the selections.

d) Click the button “Pass the value selected as story filter. The following story opens up in a new tab.

e) The story has a predefined Story Filter on Company_Code. It opens with an additional filter on “Business Unit” with the selections passed by the user:

Story%20opens%20with%20the%20user%20selections%20as%20a%20new%20story%20filter

Story opens with the user selections as a new story filter

f) We can pass more than one set of selection as story filter. In this case, we are passing one set of selection.

g) The scripts used for Dropdown, Checkbox, Input Field and the Button are as follows:

  • Based on the dimension selected in the dropdown, the checkbox items will be populated. The dimension ID is stored as myKey and passed as an argument in openStory().Script%20for%20dropdown
  • Based on the selections in the checkbox, the string “myString” is calculated which has to be passed as an argument in openStory().Script%20for%20checkbox
  • Here, input is the parameter used to include/exclude the user selections.Script%20for%20Input%20field
  • Finally, passing the arguments myKey, myString and input in openStory().

 

2.  USE CASE 2 Overview: Choose any number of members from the dimension/s in a particular widget (we have used chart) and pass your selection to a story as story filter. Here we to particularly click on the dimension members in a chart/table.Use%20Case%202%20overview%20in%20analytics%20designer

Use Case 2 overview in analytics designer

STEPS WITH SCRIPTS AND EXPLANATIONS:

We are creating a hyperlink to pass filter value from SAC Analytical Application chart and jump to story by using selected dimension as filter data point.

Actions:

a) We select, for example, the members A and B of the dimension Business_Unit.

b) On clicking the button “Apply selected values as data filter point”, we can jump to the story with story filter Business_Unit=A+B.

c)The scripts for Chart selection and the button above are shown below.

  • Here in Chart.onSelect(), we are searching for the dimension used in the chart, i.e, Business_Unit in the chart selection sel. If the selection matches, we are storing the values of sel in a string array members.Script%20for%20Chart.onSelect
  • On clicking the button “Apply selected values as data filter point”, first we are removing duplicate values from the array members. In the next part of the script, we are formulating myString2, which is passed as an argument in openStory(). The whole script is given below:Script%20for%20the%20button
  • The button “Apply selected values as data filter point” opens the following story with the user selected values as a new story filter:Story%20opens%20with%20a%20new%20story%20filter%20with%20the%20user%20selections
  • We can use any widget (table/chart) to achieve the same result.

Points to be remembered:

  • Every filter passed to a Story from Analytic Application act as a Story Filter.
  • Page-Level Filters cannot be passed.
  • Other selections like Input Control cannot be passed.
  • If there is any existing Story Filter for the dimension that we pass in URL, then the value is overwritten.
  • Analytics Designer automatically URL encodes the parameter values passed using NavigationUtils.openStory().
  • Apart from using Navigation Utility function, we can also use the same URL parameter format when we embed a Story within an HTML page or even within an Analytic Application using the Web Page widget.
  • A last argument false in openStory() will open the Story in the same browser tab. By default, the argument is true.

REFERENCES – Navigation Utility in SAC Analytics Designer:

https://help.sap.com/viewer/00f68c2e08b941f081002fd3691d86a7/release/en-US/62979224ad9a4091a7cca922063c5216.html?q=navigationUtils%20analytics%20designer

SUMMARY – This was a step by step guide to pass user selected MULTIPLE data points as story filters from analytical application to story and link the two using scripting.

Hope this blog post helps.

Thanks for reading !!

Assigned Tags

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