In the previous blog of this series, we saw how to use Date and Time range functions in analytic applications in SAP Analytics Cloud. In this blog, we will see how to pass filter values to a Drilldown WebI Report from an Analytic Application.

SAP Application Design helps in creating dynamic, interactive and customizable analytic applications. However, for CXOs, Managers, and Analysts, often a detailed report comes in handy to drill down deeper into problematic areas, to analyze and gain further insights into the data. In such cases, it is often required to pass parameters from the parent dashboard to the detailed drill-down report, so that the report shows data for the same values as selected in the dashboard.
WebI Prerequisites
To pass filter values from SAP Analytics Application Design to a drill-down WebI report, the dimensions for which parameter values need to be passed, need to be created as prompts in the WebI report. The parameters can be passed by appending ‘&’ to the report’s OpenDoc link.
OpenDocument Syntax
An OpenDocument URL is generally structured as seen below:

Once you have the drill-down WebI report ready, recreate the following steps in your Analytic Application:
1. Configure Selector Widgets
You can capture the filter values that need be passed to the WebI report by using Selector Widgets in the Analytic Application i.e. Dropdown, Radio Button Group and Checkbox Group. In this example, we will use Calendar Year as a single value prompt (DP_Year) and Rig Status (CG_RigStatus) as multiple values prompt.

2. Saving Filter Values using Global Variables
The selector widgets can be populated with values using the onInitialisation() script for live connections and by using the Builder Panel for imported connections.
a. Defining Global Variables


b. Capturing the selected values in Global Variables


3. Hyperlink to the WebI Report
You can use an Image or Shape Widget to dynamically set the hyperlink statement using scripting at run-time. As seen below, here we use a Shape Widget to set the hyperlink to be used to drill-down to the WebI report.
Note: setHyperlink() API is not available for the Text Widget. Hence it cannot be used in the current scenario.

4. Setting the Hyperlink Dynamically
The hyperlink should change dynamically based on the filters selected. To do that, we would need to capture the filter values whenever the chart changes, because of the changes in the filter selection. So, we capture filter values in the OnResultChanged() event which gets called whenever the result set displayed by the chart changes.
Note: getSelectedKeys() returns the value as a String Array, which cannot be appended to a hyperlink. So you would need to use a Control Statement to convert the String Array to String. For more information on SAP Analytics Cloud Control Statements please refer to the blog SAP Analytics Cloud – Application Design Series: 5 – Introduction to Scripting

Reach out to us here today if you are interested in evaluating if SAP Analytics Cloud is right for you.