cancel
Showing results for 
Search instead for 
Did you mean: 

Clear All Filter Script doesnot work as expected - DS1.6

former_member204732
Participant
0 Kudos

Hi Expert,

I have implemented the following script on a button in order to clear all filter apply on the datasource on design studio 1.6 " DS_1.clearAllFilters(); "

The issue is that it change also the datasource initial view. I add selected only one key figures from the 3 availables. But when I execute the script it clear all the filters and display the 3 key figures instead of the one selected.

Would you know how to solve it ?

Thanks for your help.

Elie

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member204732
Participant
0 Kudos

Thanks Poovarsan ! For your complete answer helpfull !

former_member265529
Contributor
0 Kudos

Hi David,

In design studio the key figures structure is also considered as a dimension and removing a measure is carried out as applying filter on it,

So clearAllFilters() command will also clear the filter in a key figure structure.

To avoid that use the setDataselection in charts to show the required keyfigure and use clearAllFilters() to remove filter without affecting data selection.

Or

You can use this code to clear filter on dimensions other than keyfigure structure.

var Dim=DS_1.getDimensions();

Dim.forEach(function(element, index) {

if(element.isMeasuresDimension ==false)

{

DS_1.clearFilter(element);

}

});

Thanks,

Poovarsan