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:
- 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 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 a dimension from dropdown
b) Select the members of the dimension from the checkbox (say A and B).
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 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().
- Based on the selections in the checkbox, the string “myString” is calculated which has to be passed as an argument in openStory().
- Here, input is the parameter used to include/exclude the user selections.
- 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 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.
- 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:
- The button "Apply selected values as data filter point" opens the following story with the user selected values as a new story filter:
- 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/62979224ad9a4091a7cca9220...
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 !!