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

Dropdown filtering in SAC

0 Kudos
349

 

SAP Managed Tags: SAP Analytics Cloud, analytics designer

Hi community

I am new to SAC.

I want to introduce a dropdown filtering menu in my story. I succeded in populating the dropdown using these lines of code in the onInitialization() function : 


var Inspectors_list = Table_1.getDataSource().getMembers("Don_ordre.Inspecteur");

if (Inspectors_list.length > 0) 
{
for (var i=0;i<Inspectors_list.length; i++){
Dropdown_1.addItem(Inspectors_list[i].id,Inspectors_list[i].description);
}}
 
Then i proceeded to to adding the following lines of code in the Dropdown_1 - onSelect() :

var x = Dropdown_1.getSelectedKey();
console.log(x);
Table_1.getDataSource().setDimensionFilter("Don_ordre.Inspecteur",x);


The filter is not working correctly and i do not understand why.
There is only two values in the dropdown once selected returns values , all the others returns zero.

Also i figured if it's an issue with my model , why would two values from the dropdown filter correctly and the others won't.
Mohamed_Amin_Ouerfelli_3-1723799910602.png

 

Mohamed_Amin_Ouerfelli_0-1723799786679.png
Mohamed_Amin_Ouerfelli_4-1723799954478.png

 

Mohamed_Amin_Ouerfelli_2-1723799808516.png

Also some screenshots from the modeler

Mohamed_Amin_Ouerfelli_5-1723800023068.pngMohamed_Amin_Ouerfelli_6-1723800103961.png

 



Accepted Solutions (0)

Answers (0)