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
Hi,
you can use the function DS.getFilterExt(“your_dimension”); or DS.getFilterText(“your_dimension”); .
Regards,
Giulia
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).
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
Perfect, thank you. I ended up doing something similar myself.