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:
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:
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);