on 10-04-2016 8:29 PM
All,
I have noticed that if I set a filter on a dimension (we are using Bex queries), if I use the getMembers() function on the field that has a filter set, the getMembers() function returns a list of values that does not take the filter into account.
Example:
The script for a checkbox group that acts as a dimension filter is:
DS_1.setFilter("ZBO_STDNT", me.getSelectedValues());
After filtering values via interacting with the checkbox group, the getMembers script listed below returns a list that includes the values that were filtered out.
var Students=DS_1.getMembers("ZBO_STDNT", 10000000);
Has anyone else encountered this behavior, and have you found a solution?
To address a potential question that I have seen posed in other discussions that relate to this function, I have verified that both the query and the Initial view are set to "Posted Values" for filtering.
Thanks,
Scott
Hi Scott,
I have encountered this behaviour also and have just reproduced it to confirm. My observation is that getMembers() only returns cascaded filter values based on filters applied on dimensions OTHER THAN the dimension specified in the getMembers() parameter. So in your example, if you have another dimension in the data source and swap that out for dimension ZBO_STDNT in your getMembers() statement, you should notice that this time you do get the members based on the filtered values. I guess this behaviour is by design.
I'm not aware of an approach to achieve your requirement with standard functionality. Perhaps others may have ideas. However, you can definitely achieve your requirement using the Data Iterator Component by from the SCN Design Studio SDK Development Community.
The steps are as follows:
1. Ensure that the ZBO_STDNT dimension is included in the rows panel of your data source Initial View;
2. As an example, apply the following code in the "On Data Change" event script of the Data Iterator to populate a List Box with the filtered members of the dimension:
var Students = DATAITERATOR_1.getRows();
myMembers.forEach(function(element, index) {
LISTBOX_1.addItem(element.getDimensionValueKey("ZBO_STDNT"), element.getDimensionValueText("ZBO_STDNT"));
});
Regards,
Mustafa.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Scott,
an explanation for this behaviour can be found here:
Quote: "Special case: Even if read mode Q is used, filters, which are set on the dimension for which getMemberList is executed, are ignored! They do not restrict the returned list of members for being able to change filters again. This is by design."
One addition: To avoid this behaviour we restricted the characteristic via variable (setVariableValue). This works in our case, but be aware, that this could have a performance impact, because the query needs to be loaded anew.
Best regards,
Michael
Message was edited by: Michael Simon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks to both of you! This explains the behavior very well. I think for now, I don't need to pursue the SDK option, but it's good to know it's out there. I primarily have just been testing to make sure that I understand the full behavior of getMembers before I use it in any application of significant scale.
Thanks again.
Scott
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.