cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the filtered members of a datasource in sap lumira?

07makita
Participant
0 Kudos
578

I filtered out some entries in the query. Now I want the correct values to be displayed. However, all values are still displayed. How can I change this?

This is my code:

gv_cluster = "";
gv_cluster_txt = "";
DS_CLUSTER.getMembers("AXSTR",30).forEach(function(element,index) {
gv_cluster = gv_cluster + element.externalKey + ";";
}
DS_CLUSTER.setFilterExt("AXSTR", gv_cluster,false);



Does it work with the getFilterExt() function? If yes, how can I do that?

View Entire Topic
MartinKolb
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Sevim,

for filtering you need to use the "internalKey" instead of "externalKey".

So this code block will work:

gv_cluster = "";
DS_CLUSTER.getMembers("AXSTR",10).forEach(function(element,index) {
gv_cluster = gv_cluster + element.internalKey + ";"; }); DS_CLUSTER.setFilterExt("AXSTR", gv_cluster, false);

After calling "setFilterExt", all components that show the content of this data-source (e.g. Crosstab, Chart, ...) will have the filter applied.

Best regards

Martin

07makita
Participant
0 Kudos

Hi Martin,

I tested it with the internalKey but i still get all the results and not the filtered. I only want to have the values that I have narrowed down in the query in the backend.

MartinKolb
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Sevim,

I’m not sure if I understand this correctly. More specifically, what do you mean with “narrowed down in the query in the backend”. By calling “setFilterExt” the query is narrowed down to the items that are given as parameter. Then the backend re-executes the query and presents the reduced result-set in the components that are associated with the data-source that you have called “setFilterExt” on. In my example the filter takes the first 10 members of the dimension, in your original example these are the first 30 of them.

Could you elaborate a bit more how your application is structured? E.g. do you use data-sources from BW, HANA or Universe? Which component is used to display the data of DS_CLUSTER? When is the script executed that you showed (during startup?, when the user clicks a button?,…).

You might also attach some screenshot, or the XML definition of the application (you can get the XML definition by pressing Shift+Ctrl+Alt+X when in Lumira Designer). With that information I might be able to give you some more hints how to resolve your issue.

07makita
Participant

Hi Martin,

now it worked. in the backend I restricted the values instead of adding a filter. Now I add a filter.

Best regards,

Sevim