cancel
Showing results for 
Search instead for 
Did you mean: 

GetMemberList - How can I filter returned values?

0 Kudos

I am trying the following:

I use a HANA calculation view as a data source. I want to fill a dropdown-box via script with the dimension values from the data source and I want to filter the values. The filter is not set on the dimension which I want to fill the dropdown box with.

It seems that is not possible - getMemberList always returns all dimension values, no matter what I do. Until now, I tried the following:

- Setting a background filter in the initial view

- Using SetFilter-Statement in the script for event "On_Startup"

- Creating a variable in my HANA calculation view and using setVariableValue as well as setVariableValueExt as suggested here: https://archive.sap.com/discussions/thread/3862501

- Using Property Binding with "Follow Filter state" set to 'true'

None of these were successful.

When I link a crosstab or a chart component to my view, the filter as well as the variable works fine, so I think the HANA calculation view cannot be the problem.

In thread https://archive.sap.com/discussions/thread/3741008 I read the following:

"getMemberList retrieves a list including all values, possible for current filter settings / selection.
getMembers retrieves all possible values for selected dimension. The current filter settings are ignored."

but in my case, getMemberList also ignores all filter settings.

I've also read SAP Note 2067424. The last statement there says: "Dynamic filters, which were applied on the same dimension for which getMembers or getMemberList is executed, are ignored by design.", but as I mentioned already above, I don't set the filter on the same dimension for which I execute getMembersList.

I am using DS 1.6 SP4, connected to BI-Plattform 4.2.

I think there must be a way to fill a dropdown (or listbox etc.) with values from a data source under consideration of filters, or not?

Thanks in advande and best regards,
Oliver

TammyPowlas
Active Contributor
0 Kudos

Great research on your question

Have you seen this thread and Bogdan's reply: https://archive.sap.com/discussions/thread/3837623

0 Kudos

Hello Tammy,

the blog you've mentions recommends using SetVariableValue respectively SetVariableValueExt. I tried this already without success, see the beginning of my question above.

Best regards,

Oliver

Accepted Solutions (1)

Accepted Solutions (1)

MustafaBensan
Active Contributor
0 Kudos

Hi Oliver,

What you have described is a standard cascading filter scenario which should work out-of-the-box if you apply setFilter() in the "On Startup" event of the application or even as a Background Filter in the Initial View.

Have you set the Members for Filtering option of the dimension used to fill your list to "Only Values with Posted Data" in the Initial View of the data source?

Regards,

Mustafa.

MustafaBensan
Active Contributor
0 Kudos

Hi Oliver,

Further to my suggestion above, I have created a working example with a BW BEx data source as shown below. Exactly the same principle should also apply to HANA data sources.

Initial View without Background Filter:

Initial View with Background Filter Applied:

Members for Filtering Setting in Initial View:

On Startup script code:

var myMemberList = DS_1.getMemberList("ZAIRLINID", MemberPresentation.INTERNAL_KEY, MemberDisplay.TEXT, 100);

LISTBOX_1.setItems(myMemberList);

Result - list shows filtered members as expected, same as Crosstab:

Answers (1)

Answers (1)

0 Kudos

Hello Mustafa,

setting the Members for Filtering option in the initial view solved my problem.

Many Thanks!

MustafaBensan
Active Contributor
0 Kudos

Hi Oliver. Glad it worked. Although a simple solution, that setting is easy to overlook 🙂