Apply Filters to an SAP Analytics Cloud Story
- How to set a filter for a specific model of an embedded SAP Analytics Cloud story
- How to gather necessary IDs and values for filter definition
- How to make use of the SAP Analytics Cloud URL API to request all stories including their models from a tenant
Prerequisites
- You have created the web app, as described in the tutorial Embed an SAP Analytics Cloud Story in a Simple Web App, and you have embedded an SAP Analytics Cloud story.
- You have added display parameters, as described in the tutorial Modify the Way an Embedded Story is Displayed, and you have embedded an SAP Analytics Cloud story.
In the previous tutorial, Modify the Way an Embedded Story is Displayed, you have learned how to use the SAP Analytics Cloud URL API to change the look and feel of an embedded story. This is just a small part from that what the SAC Rest-based APIs can deliver in terms of functional scope. For analytical purposes, it is often necessary to look at the results for a particular period of time or calculate results for a particular group of people. These are some of the reasons why filters are required. In SAP Analytics Cloud the filter parameters can be added to the story URL as additional query parameters. This enables you to adjust even further the story you want to embed.
The following parameters are available:
f<XX>Model
: specifies which model of a story the filter needs to be applied to. The value has to start with the package name, followed by the model name. For example:sap.epm:BestRunJuice_SampleModel
.f<XX>Dim
: identifies the dimension to apply the filter to.f<XX>Hierarchy
: indicates a hierarchy to filter (optional).f<XX>Op
: filter operatorin
ornotIn
. By default the value isin
(optional).f<XX>Unbooked
: enable filtering on unbooked data. The value can betrue
orfalse
and is set to false by default (optional).f<XX>Val
: This is the value you want to filter on. The API expects the ID of the dimension members.
<XX>
within a filter definition, it is a freely selected two-digit number and is used to specify which parameters belong together. This is important when more than one filter is passed. The passed filter is applied only to the embedded story and will not be persisted.
You can find a detailed description of the parameters in the API documentation.