Skip to Content
1
Dec 02, 2019 at 09:57 AM

SAC: Passing the filter parameter between Analytics Apps

1427 Views Last edit Dec 03, 2019 at 05:33 AM 4 rev

Hello, all.

I have a question about passing the filter value in SAP Analytics Cloud (SAC).

I can't pass the filter value from analytics application to analytics application.

Goal: Passing the filter value which is set in the Screen_1 (analytics application) to the Screen_2 (analytics application)

Assumption:

Widgets I set are as follows.

- Screen_1 (From)

Dropdown_1: Select the filter dimension

Dropdown_2: Select the filter value

Button_1: Trigger for jumping to Screen_2

Chart_1: Chart

- Screen_2 (To)

Chart_2: Chart

My Trial in 2 ways:

1. Adding the filter parameter on URL

Reference:

https://help.sap.com/viewer/a4406994704e4af5a8559a640b496468/release/en-US/0c84d524ee1c4b88836287579cae7923.html

Result:

Screen_1 jumped to Screen_2 but I couldn’t filter Chart_2.

Code:

[Button_1 onClick]

/*Add the filter parameter on URL and jump to Screen_2 */
NavigationUtils.openApplication(<Application ID>, [UrlParameter.create("f01Model",<MODEL ID>),UrlParameter.create("f01Dim", Dropdown_1.getSelectedKey() ),UrlParameter.create("f01Val",Dropdown_2.getSelectedText() )],true);

2. Include the filter parameter in Script Variable

Reference:

https://help.sap.com/viewer/00f68c2e08b941f081002fd3691d86a7/release/en-US/82bbae6b7005482c87bfd59a91735b45.html

Result:

Key can’t be recognized as URL and so Screen_1 couldn’t jump to the Screen_2

Key ex: [ID_Product].[ID_Category].&[Vegetable]?

Code:

[Button_1 onClick]

/* Pass the Key input in Dropdown_1 to Script Variable */
filter_dim=Dropdown_1.getSelectedKey();filter_member=Dropdown_2.getSelectedKey();

/*jump to Screen_2 with passing the Script Variable */
NavigationUtils.openApplication(<Application ID>,[UrlParameter.create("p_filter_dim",filte
r_dim),UrlParameter.create("p_filter_member", filter_member)],true);

[Screen_2 onInitialization]

/*Assign the Script Value to the filter in Chart_2 */
Chart_2.getDataSource().setDimensionFilter(filter_dim,filter_member);