cancel
Showing results for 
Search instead for 
Did you mean: 

SAC (Analytic Application) || Set Dimension Filter does not work on tables properly

0 Kudos

Hello everyone, I have noticed that setting "measure" filters in tables is extremely error prone.

The data is basically consumed via a BW Live connection. Now we have a requirement to exchange measures in a table by selecting a field from a dropdown. I noticed that measure filters using table.getDataSource.setDimensionfilter([a,b,c,...]) are partly not set.

Often only 2 of the 5 selected measures are filtered. If I add all 5 measures to the table in the design time, it works without any problems but as soon as I try to set them via the scripting functions - the filter won't apply in the table.

Can someone tell me the cause ? The problem is extremely annoying, because we now have to use about 6 tables instead of one, simply for the reason that the filter function for the table does not work properly.

Best regards

chia-yu_wu
Active Participant

Hi torben.henke,

could you share your coding?

It may help us analyzing what went wrong.

cheers,

Chia-Yu

0 Kudos

Hello chiayuwu

for sure I can do that. It's pretty simple:

If you press button 1 the scripting states:

Table_Area_Data_Comparison_Main_SecondArea_3_FullYear.removeDimensionfilter(Alias.MeasureDimension);

Table_Area_Data_Comparison_Main_SecondArea_3_FullYear.getDataSource().setDimensionFilter(Alias.MeasureDimension,[a,b,c,d,e,f,g]);

If you press button 2 the scripting states:

Table_Area_Data_Comparison_Main_SecondArea_3_FullYear.removeDimensionfilter(Alias.MeasureDimension);

Table_Area_Data_Comparison_Main_SecondArea_3_FullYear.getDataSource().setDimensionFilter(Alias.MeasureDimension,[h,i,j,k,l,m,n]);

Accepted Solutions (0)

Answers (2)

Answers (2)

arthur_
Member
0 Kudos

Rather than writing Alias.MeasureDimension as the auto complete suggests, you have to write "@MesureDimension"

Example:

table.getDataSource().setDimensionFilter("@MeasureDimension","Mesure1");

SimonKranig
Product and Topic Expert
Product and Topic Expert
0 Kudos

It is perfectly fine to use Alias.MeasureDimension to address the measure dimension in this command.

torben.henke : could you check the filters after setting them via getDimensionFilters

https://help.sap.com/doc/958d4c11261f42e992e8d01a4c0dde25/release/en-US/index.html#DataSource_MgetDi...

Are there values available for these measures (booked vs. unbooked...)

regards,

Simon

chia-yu_wu
Active Participant
0 Kudos

Hi torben.henke,

your coding seems to be correct.

just to mention, you don't really need to removeDimensionfilter in this case.

Just put in the setDimensionFilter would be enough.

Maybe one thing, but you probably have already added.

Make sure that Measures is already added into the table in your designtime.

PS. did you build the measure array on your own, or did you use the combi keyboard:

ctrl + space and select the members through "open member selector".

Hope this helps you a little bit further.

Cheers,

Chia-Yu