Skip to Content
Technical Articles
Author's profile photo Saurabh Suresh Sonawane

Dynamic adding ALL in the drop down / Dynamic adding LOV in drop down in SAP analytics cloud.analytics Designer

Hi All, Writing the blog post to explain how to add the ALL value in the Drop down in the SAP analytics cloud.analytics Designer

To do this we need to follow the below step.

 

Step 1 : Add a new drop down on the canvas

Add a default one LOV for the drop down.

 

Step 2:  We need to create a Script variable

prod_drop_dyn_array

 

 

step 3: We have to write the following script on Initialization

var res = Chart.getDataSource().getResultSet();

console.log(res);

for( var i=0; i<res.length; i++) {

prod_drop_dyn_array[i]= res[i][“prod1”].id;

Dropdown_prod.addItem(res[i][“prod1”].id);

}

 

Step 4:

Now on the Dropdown on select function we have to write the below scripts

Var dropdownprod_Selectedkey = Dropdown_prod.getSelectedKey();

 

for( var i=0; i< prod_drop_dyn_array.length; i++) {

prod_drop_dyn_array[i]=””;

}

if (dropdownprod_Selectedkey ===”all”){

var res = Chart.getDataSource().getResultSet();

for(  i=0; i<res.length; i++) {

prod_drop_dyn_array[i]= res[i][“prod1”].id;

}} else {

prod_drop_dyn_array[0] = dropdownprod_Selectedkey;}

 

So in the script variable (prod_drop_dyn_array) we have exact LOV.

We can use above variable to filter table and chart in the application at run time.

 

Thanks,

Saurabh S.

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.