With 2021.QRC2, we provide the option for the Generic Analysis application to set e.g. variable and/or filter values ​​using URL parameters.

This blog describes how the parameters can be defined and how they can be applied.

Model Parameter

Model parameter can be used for the application widget Table.

Parameter Values Options
p_ModelId <MODEL_ID>

Set the model to the table. The ID must be one of the following:

A model ID with format

  • <package_name>:<object_name> t.1.BestRun_Advanced:BestRun_Advanced
  •  <guid>                                    Cc4gs7k4qsudnqrbsf4egw9hc0

The parameter value must be URL encoded to work properly. Without URL encoded parameter, model Id may not be properly applied.

Variable Parameters

Variable parameters can be supplied for an application widget using a model with variable constraints.

Note

Variable parameters may be combined with filter and open prompt parameters. Any variables will be applied to the application before filters are applied.

Limitation

The parameter <p_ModelId> works not together with p_Variable. If you would like to set the variables via URL, then you need to use the same model in the sender and receiver application.You can use a bookmark url and the variable parameters. The bookmark must be based on the same model and the parameter <p_ModelId> is not required.

All parameter values must be URL encoded to work properly. Without URL encoded parameters, variables may not be properly applied.

For example, PM_COUNTRY_SELOPT$Multiple$DE,FR must be encoded as PM_COUNTRY_SELOPT%24Multiple%24DE%2CFR.

 

Parameter Values Options
p_Variable <VARIABLE_INFO>

Identifies the variable and the values to apply the parameter too.

<VARIABLE_INFO> consists of several parts.

Parameter Syntax:

p_Variable=<VARIABLE_ID>$<TYPE>$<VALUES>$<EXCLUDE>$$

 

1. <VARIABLE_ID> is the variable to apply the parameter value too.

2. $ is a character to separate the variable information from each other.

3. <TYPE> defines which type the variable values ​​are

  • Single    –> single value
  • Multiple  –> multiple values
  • Range    –> range values

4. <VALUES> are the variable values for a variable. The parameter uses the IDs you want to set the variable value

  • Single value: <VALUE>
  • Multiple values: <VALUE1>,<VALUE2>
  • Range values: <VALUE1>-<VALUE2>

<VALUE> is the technical name for a variable value.

5. <EXCLUDE> indicates whether the values ​​are included or excluded.

Optional. By default, set too true.

Use true if you want to include the variable values in the member selection.

Use false if you want to exclude the variable values in the member selection

6.  $$ is a character to separate the variable parameter from each other.

With this separator it is possible to set several variables

Note

If any supplied values cannot be resolved with the data source the variable value will not be applied.

To find a variable ID and variables values:

1.  Open an application in SAP Analytics Cloud.

Select  (Edit Prompts). A list of variables used in the application would appear if any models used by the application require prompts.

p_Prompt

 

Optional.

By default, set to false

true, false

Set this value too true if you want the prompt dialog to open.

The variable values ​​that were transferred via url parameters are set first and then the prompt dialog is opened.

 

Unencoded Example URL:

https://<Tenant>/sap/fpa/ui/tenants/1fb7f/app.html#;mode=view;view_id=appBuilding;appId=F369AB05B762BA9624B25AF5C1747618;p_Variable=PM_CALMONTH_INT$Range$202001-202012$$PM_COUNTRY_SELOPT$Multiple$DE,FR

Encoded Example URL:

https://<Tenant>/sap/fpa/ui/tenants/1fb7f/app.html#;mode=view;view_id=appBuilding;appId=F369AB05B762BA9624B25AF5C1747618;p_Variable=PM_CALMONTH_INT%24Range%24202001-202012%24%24PM_COUNTRY_SELOPT%24Multiple%24DE%2CFR

 

FILTER Parameters

Parameters to apply filters to an application can be added to the open application URL.

If filters already exist for the specified application/widget, the filters applied in the URL will replace any filters on the same dimension. Any existing saved filters that are not replaced will continue to be applied in addition to the URL specified updates and additions. Filter parameters may be combined with display and variable parameters. Any variables will be applied to the application before filters are applied.

Note

Variable parameters may be combined with filter and open prompt parameters. Any variables will be applied to the application before filters are applied.

All parameter values must be URL encoded to work properly. Without URL encoded parameters, variables may not be properly applied.

Example: p_ModelId=t.1.BestRun_Advanced:BestRun_Advanced;p_Filter=Location_4nm2e04531$Multiple$[Location_4nm2e04531].[States].&[CT1],[Location_4nm2e04531].[States].&[CT2]$false$States$$

encoded as

p_ModelId=t.1.BestRun_Advanced:BestRun_Advanced;p_Filter=Location_4nm2e04531%24Multiple%24%5BLocation_4nm2e04531%5D.%5BStates%5D.%26%5BCT1%5D%2C%5BLocation_4nm2e04531%5D.%5BStates%5D.%26%5BCT2&5D%24false%24States%24%24

 

Parameter Values Options
p_Filter <FILTER_INFO>

Identifies the filters and the values to apply the parameter to.

<FILTER_INFO> consists of several parts.

Parameter Syntax:

p_Filter=<DIMENSION_ID>$<TYPE>$<VALUES>$
<EXCLUDE>$<HIERARCHY>$$

 

1. <DIMENSION_ID> is the dimension Id to apply the parameter value too.

2. $ is a character to separate the filter information from each other.

3. <TYPE> defines which type the filter values ​​are

  • Single    –> single value
  • Multiple –> multiple values
  • Range   –> range values

4. <VALUES> are the filter values for a dimension. The parameter uses the IDs of the dimension members you want to filter on.

  • Single value: < MEMBER_ID>
  • Multiple values: < MEMBER_ID 1>,< MEMBER_ID >
  • Range values: < MEMBER_ID 1>-< MEMBER_ID2

<VALUE> is the technical name for a variable value.

5. <EXCLUDE> indicates whether the values ​​are included or excluded.

Optional. By default, set too true.

Use true if you want to include the variable values in the member selection.

Use false if you want to exclude the variable values in the member selection.

Note

The Exclude indicator work together with Single and Multiple values. Ranges are not supported.

6. <HIERARCHY> specifies a hierarchy on which to filter.

Note

The member id depends on the selected hierarchy, so the hierarchy must always be specified as a parameter

7. $$ is a character to separate the filter parameter from each other.

With this separator it is possible to set several filter parameters.

Note

If any supplied values cannot be resolved with the data source the filter value will not be applied. 

 

Unencoded Example URL:

https://<Tenant>/sap/fpa/ui/tenants/1fb7f/app.html#;mode=view;view_id=appBuilding;appId=F369AB05B762BA9624B25AF5C1747618;p_ModelId=t.1.BestRun_Advanced:BestRun_Advanced;p_Filter=$$Location_4nm2e04531$Multiple$[Location_4nm2e04531].[States].&[CT1],[Location_4nm2e04531].[States].&[CT2]$false$States$$Product_3e315003an$Multiple$PD1,PD12$true$@FlatHierarchy

 

Encoded Example URL:

https://<Tenant>/sap/fpa/ui/tenants/1fb7f/app.html#;mode=view;view_id=appBuilding;appId=F369AB05B762BA9624B25AF5C1747618; p_ModelId=t.1.BestRun_Advanced:BestRun_Advanced;p_Filter=Location_4nm2e04531%24Multiple%24%5BLocation_4nm2e04531%5D.%5BStates%5D.%26%5BCT1%5D%2C%5BLocation_4nm2e04531%5D.%5BStates%5D.%26%5BCT2&5D%24false%24States%24%24Product_3e315003an%24Multiple%24PD1%2CPD12%24true%24%40FlatHierarchy

Additional Information

With the Analytics Designer Sample Content via ACN, we provide two sample analytical applications. They show how the URL parameters are generated and how they are interpreted via script.

  • Feature – URL Parameter – Sender_App
  • Feature – URL Parameter – Receiver_App

Here is a script example of how to create the filter parameters for all filtered dimensions of a DataSource.

You check for all dimensions whether a filter has been set and if a filter is available, the filter is then converted into the required URL syntax. It is important that the associated hierarchy is determined, since the values ​​are dependent on the hierarchy.

Sender_APP

Receiver_App

Here is a script example, how the url filter parameters are interpreted and the filters for the dimensions are set.

The sample applications also contain the scripts for the variable values.

Enjoy !!

 

Randa Khaled

Randa Khaled

Author Since: November 19, 2020

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x