I am having a problem when implementing Getfilter. Until now I always returned the members object with the key and all its values but now it is returning me in some cases ‘exclude’. I need that when updating a filter (check) it is always “members” or failing ‘include’.
Thank you for your question.
We would like to kindly inform you that filters configured through UI will be returned as an array of
members or excluded members depending on the quantity of selected members. In case the amount of members selected to be displayed in the report is half of the whole amount of members or less, the
s array will be returned. Otherwise, thegetReport
method returnsexclude` array.
In case the only possible variant for you is to receive an array of members selected to be displayed, we recommend using an approach based on getting all members of the hierarchy with the
getMembers method and finding the difference or union between them and the received filter.
Please see an example we have prepared for you demonstrating such an approach. You are welcome to test it by selecting members of the “Color” hierarchy. The results will be printed in your browser’s console.
We hope it helps.