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

Clear filter button should reset all the filters SAC Analytics Application

0 Kudos
4,958

I need to clear all the input filters . I have around 10 input control, but when i am trying to clear its not working. tried so many options like sending " " to the set selected members, passing all. Please advise

Accepted Solutions (0)

Answers (4)

Answers (4)

N1kh1l
Active Contributor

vaishanavibashyam

vaishanavibashyamWith SAC QRC Q2 2023 release two new APIs for dimension filter will be introduced as below

  • ‘setAllMembersSelected’ – script API to set “All” members in Input Control
  • ‘isAllMembersSelected’ – script API to identity whether member “All” is selected

https://blogs.sap.com/2023/04/11/whats-new-in-sap-analytics-cloud-release-2023.07/

You can use below to select All members

InputControl_1.getInputControlDataSource().setAllMembersSelected();
babym
Explorer
0 Kudos
The solution working perfectly. Thank you.
JBARLOW
Active Contributor

As a quick example you could loop through an array of the tables (or charts etc) in the app and remove the filter.

Using the BestRunJuice sample data, the button contains code to remove the 'Sales Manager' dimension filter from all three tables.

We also use a Global script variable to store the 3 table id's before removing the filter.

Button Code:
You can of course enhance the code so it dynamically takes the dimension filter from each table and removes it.
Depending upon performance, the getDatasource call could be made outside of the for Loop as well.

// Write all the table id's to the arr_tables Script variable
arr_tables = Application.getWidgets({type:WidgetType.Table});

// Loop through all the tables stored in the arr_tables script variable and remove the Sales Manager Dimension filter from them

for(var i=0;i<arr_tables.length;i++)
	{arr_tables[i].getDataSource().removeDimensionFilter('Sales_Manager__5w3m5d06b5');}<br>


Script Variable 'arr_tables'

0 Kudos

Trying to clear all the filter values of all input control , so remove dimenion is not working

sourabhpaul
Participant
0 Kudos

Hi,

You have to remove the dimension filter from each widget separately.

you can use this code:

widget_name.getdatasource().removedimensionfilter();

N1kh1l
Active Contributor
0 Kudos

vaishanavibashyam

Have you tried using the below Script API

Table.getDataSource().removeDimensionFilter

Nikhil

0 Kudos

after changing the value of dimension in input control and using the remove dimension filter is not working

N1kh1l
Active Contributor
0 Kudos

vaishanavibashyam

Can you try the below

InputControl_1.getInputControlDataSource().setSelectedMembers("");

Nikhil
0 Kudos

Hi Nikhil: I tried this but I get an error. I have a popup window where I have few charts and a input control. When I select a value in that input control and then close the popup by clicking on the close button I created it closes the popup, which is great. But when I go back and click on the popup the filter that I previously selected is still there. I want to reset the input control on close or when I open the popup. I am not a JAVA developer. Any help is appreciated!