cancel
Showing results for 
Search instead for 
Did you mean: 

Fetch member description

JBARLOW
Contributor
0 Kudos
365

Good morning all,

Just wondering if there is any way to avoid the Fetch Member Description query hit?

Using the BestRunJuice sample data i've been playing around - simply filtering a chart via a dropdown list.
When a value is selected from the dropdown as expected we see a Fetch member call in the performance monitor ...

However there does seem to be caching occurring as if a dropdown value is selected a 2nd time, not Fetch Member Desc call occurs.

Below we select - Online , then Retail then Wholesale -- then Select 'Online' again and -- no Fetch Member hit occurs.

As a 2nd test I created a Global variable that is populated with the dimension members onInitialisation, this also does not cause the Fetch Member call to be invoked.

I've tried using this Global variable in the dropdown code as per below:

var KEY = DDL.getSelectedKey();
DS_GLOBAL.setRefreshPaused(true);
for (var x=0;x<DIMVALS.length;x++)
{ if (KEY===DIMVALS[x].id)
{DS_GLOBAL.setDimensionFilter(GLOBAL_DIM,KEY);}}
DS_GLOBAL.setRefreshPaused(false);

We still see Fetch Members in the script log.

More oddly performing a console.log to display the members in the console does not invoke the Fetch Member call

Accepted Solutions (1)

Accepted Solutions (1)

Bob0001
Advisor
Advisor

Please refer to "Use MemberInfo Object with setDimensionFilter()" and "Prefer copyDimensionFilterFrom() over setDimensionFilter()" in Dev Handbook.

JBARLOW
Contributor
0 Kudos

Thanks Bob,

I get the CopyDimension stuff, it was more a question as to why:


1. If we populate a global array variable with dimension members onInitialisation
2. Console log that array
This doesn't generate a Fetch Members function call..

Yet if the dropdown calls values from the Array - it does generate the call
Also why if a member value is selected a 2nd time during a session - no Fetch Members is invoked.

Cheers

James

Bob0001
Advisor
Advisor
0 Kudos

The member descriptions are cached, so you will see this additional request just once per member ID. If you have the member description at hand than you should use the pattern as described in "Use MemberInfo Object with setDimensionFilter()" chapter to avoid the roundtrip at all:

Table_1.getDataSource().setDimensionFilter("sap.epm:Department", {id: memberId,
description: memberDescription});

Just logging a variable or array to the console will not cause any requests.

In case your array contains MemberInfo instances and you pass them as filter you avoid the roundtrip as the MemberInfo type contains the description already.

Also using pauseRefresh in your scenario does not any effect. The additional request is still made.

JBARLOW
Contributor
0 Kudos

Thanks Bob,

"In case your array contains MemberInfo instances and you pass them as filter you avoid the roundtrip as the MemberInfo type contains the description already."

I thought this as well, hence I used an array - yet it still seems to perform the roundtrip - not sure why it does mind you

Bob0001
Advisor
Advisor
0 Kudos

You need to pass the whole member instance not just the id:

DS_GLOBAL.setDimensionFilter(GLOBAL_DIM,DIMVALS[x]);
JBARLOW
Contributor
0 Kudos

Cheers Bob,

I used this code in the end, no Fetch Members is performed 🙂

1. Get the ddl key
2. If the selected key = one of the dimension member id's then apply the value as a filter
3. Once done copy the filter across to all other charts contained with the array variable 'Charts'

Answers (1)

Answers (1)

dominik_zed
Participant
0 Kudos