Blogs / SAP / SAP BusinessObjects / SAP Design Studio / General / Working with BEx conditions in SAP BusinessObjects Design Studio

Working with BEx conditions in SAP BusinessObjects Design Studio

Jul 9, 2015


When there is a need to implement conditions or set filters on key figures in SAP BusinessObjects Design Studio dashboards, it becomes a challenge to achieve this directly in the application. To implement this functionality in our SAP BusinessObjects Design Studio dashboards, we require the help of SAP Business Explorer (BEx). Setting filters on Key Figures can be achieved by defining Conditions in SAP Business Explorer (BEx).

This blog post gives an insight into manipulation of SAP Business Explorer (BEx) conditions in SAP BusinessObjects Design studio.

Two types of conditions in SAP Business Explorer (BEx) are:-

          i) Conditions with variables

         ii) Conditions with constant values

Conditions with variable

In this case, the condition works on the input value of the variable.

To toggle the state of a condition, we can pass null value to its variable. When null value is passed, the condition is temporarily inactive. So we can pass the values for the required condition variable and pass null value to rest of the variables.

//To set the value of the condition variable in BEx with null
APPLICATION.setVariableValueExt(variablename,” ”);

Conditions without variable

In this case, we cannot pass a value to the condition in runtime i.e. from SAP BusinessObjects Design Studio.

So if we have more than one condition, we can use a variable to get all the conditions defined in the Query as an array, and set the state of the condition in SAP BusinessObjects Design Studio as active or inactive.


//Storing all the conditions on the data source to a variable
    var  condition = DS_1.getMeasureFilters();
condition.forEach(function(element, index)
//Setting  the required condition as active
DS_1.setMeasureFilterActive(element, true);}
DS_1.setMeasureFilterActive(element, false);}

In the above example only the condition with name CONDITION1 is active and all other conditions are inactive.

*This approach can also be used in conditions with variables if necessary.

Consider a scenario when Top N and Bottom N are to be reported.

We can define 2 conditions; one for Top N and other for Bottom N in the same query. And in SAP BusinessObjects Design Studio, we can toggle the condition states to display the Top N and Bottom N as and when required.

Working with BEx conditions in SAP BusinessObjects Design Studio

To Display Top N use the following script:

DS_1.setMeasureFilterActive(“ADM”, false);
DS_1.setMeasureFilterActive(“CONDITION1”, true);

To Display Bottom N use the following script:

DS_1.setMeasureFilterActive(“CONDITION1”, false);
DS_1.setMeasureFilterActive(“ADM”, true);

This eliminates the need of 2 data sources with each of the conditions give separately.

Corporate HQ:
5920 Windhaven Pkwy, Plano, TX 75093

+1 888-227-2794

+1 972-232-2233

+1 888-227-7192

Copyright © Visual BI Solutions Inc.

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Join our mailing list to receive the latest news and updates from our team.

You have Successfully Subscribed!

Share This!

Share this with your friends and colleagues!