Use MemberInfo Object in setDimensionFilter() API

Use a MemberInfo object in addition to member ID in setDimensionFilter() API. This improves your story or analytic application's performance as there’s no roundtrip to the backend to fetch the member’s description.

If you use the method setDimensionFilter() on a data source and pass only a member ID, then there's a roundtrip to the backend to fetch the member’s description:

var memberId = Dropdown_1.getSelectedKey();
Table_1.getDataSource().setDimensionFilter("sap.epm:Department", memberId);
// Roundtrip performed to fetch member description

When you pass a MemberInfo object instead, which contains a description, then there's no roundtrip to the backend:

Sample Code
var memberId = Dropdown_1.getSelectedKey();
var memberDescription = Dropdown_1.getSelectedText();
Table_1.getDataSource().setDimensionFilter("sap.epm:Department", {id: memberId, 
description: memberDescription});
// No roundtrip performed to fetch member description. It's already present.

You can also use an array of MemberInfo objects:

Sample Code
var resultSet = Table_2.getDataSource().getResultSet();
var memberInfos = ArrayUtils.create(Type.MemberInfo);
for (var i = 0; i < resultSet.length; i++) {
 var member = resultSet [i]["sap.epm:Department"];
 var memberId = member.id;
 var memberDescription = member.description;
 memberInfos.push({id: memberId, description: memberDescription});
}
Table_1.getDataSource().setDimensionFilter("sap.epm:Department", memberInfos);
// No roundtrips performed to fetch member descriptions. They're already present.

Whenever the member description is available to you, use MemberInfo to improve your story or application's performance.

Note

If the descriptions in the filter aren't visible to the end users, simply use a dummy description.