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.
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.
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
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 !!