cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAC Application script, chart onselect value passing into url parameter

kiran_s611
Explorer
0 Likes
1,206

Hi All,

I am trying to capture the selected dimension value from a chart. This value i am trying to pass into URL parameter to child report. 
Value is getting passed to child report but data is not getting filtered. 

I have created script variable "RegionFilter" both in parent report and child report. 

When i am passign the parameter value from a Dropdown or Check box, data is getting filter in child report, but with chart it is not working. 
Parent report parameter passing url :- 

NavigationUtils.openStory("9E218282F57BE2D4EBBC6959FE0D0AB1", "a31b3cd2-f023-4b22-ac46-3e90b81c8e7a",
[UrlParameter.create("p_RegionFilter",CB_Country.getSelectedKeys().join("|")),UrlParameter.create("p_MaterialFilter",List_Material.getSelectedKeys().join("|"))]);

Child report logic to apply filter :-

RegionFilter;
console.log(RegionFilter);
 
if (RegionFilter==="ALL") {
console.log(RegionFilter);
Table_1.getDataSource().removeDimensionFilter("Country");
}
else if (RegionFilter!=="ALL") {
console.log("Chart selected value ... "+ RegionFilter);
Table_1.getDataSource().setDimensionFilter("Country",RegionFilter.split("|"));
}
 
Can anyone of you please help me in this.
Thanks,
Subash

Accepted Solutions (0)

Answers (1)

Answers (1)

N1kh1l
Active Contributor
0 Likes

@kiran_s611 

Table_1.getDataSource().setDimensionFilter expects either a string or an array of string members as parameters. Please ensure when you are passing you are respecting the format. 

When you read values from chart selection they might not be in the correct format as expected by the API. The below blog will help you.

https://community.sap.com/t5/technology-blog-posts-by-members/sac-analytic-application-reusable-scri...

 

Nikhil

kiran_s611
Explorer
0 Likes

Hi  @N1kh1l  ,
Thanks for your suggestion. By going through the link suggested by you i have tried with the below code, which worked for me. 

kiran_s611_0-1759500218430.pngkiran_s611_1-1759500243681.png

Thanks for your help.

 

kiran_s611
Explorer
0 Likes
Hi Nikhil
N1kh1l
Active Contributor
0 Likes
Kiran, I am glad it worked for you. Could you please close the thread by accepting the answer so that i can be helpful to others.