cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to get filtered members?

Former Member
0 Kudos

I'm currently getting the members of a dimension using the getMembers function and passing them to an array, which works fine. However, once a user adds a filter, the getMembers function still returns all unfiltered members. Is there a function or a way to get only the filtered (shown) members into an array?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Hi,

you can use the function DS.getFilterExt(“your_dimension”); or DS.getFilterText(“your_dimension”); .

Regards,

Giulia


Former Member
0 Kudos

Is there also a way to get a sorted result? This returns the items in the order they were clicked on when the user created the filter (instead of alphabetical order).

Former Member

Hi,

you might try this workaround:

var filter = DS.getFilterText("dimension").split("; ");
var text = "";
var lov = DS.getMembers("dimension", 99);
lov.forEach(function(element, index) {
filter.forEach(function(element2, index2) {
if(element2 == element.text){
text = text + element2 + "; ";
}
});
});
TEXT_1.setText(text);

design studio writes the dimension members in alphabetical order, so I use that list to sort the filter list.

Regards,

Giulia

Former Member
0 Kudos

Perfect, thank you. I ended up doing something similar myself.

Answers (0)