Skip to Content

Swap key figures on radiobutton selection

Dear Experts,

I am trying to achieve a functionality where I have three radio buttons named Revenue Margin and Volume and then there then two charts showing the data for top/bottom 5 performers based on Revenue/margin and Volume by Customers.

At the moment, I have used the the following script the change the key figure based on the radio button selection.

if (RADIOBUTTONGROUP_1.getSelectedValue()=="Volume") { INFOCHART_1.setDataSelection({ "Keyfigures": "Volume"}) ;}

and similar code for Revenue and margin radiobutton selection.

However, the problem is that I have selected the top/bottom 5 customers based on Margin (default selection) manually.

Now, when i change the radiobutton from Margin to Volume, I could see more than 5 customers rather than just top 5 customers based on the volume.

Is there any way to handle the top 5 customers to implement with the help of script and then change the key figure dynamically



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Mar 23, 2017 at 01:01 PM

    Hi Sumit,

    Can you clarify exactly what you mean by "I have selected the top/bottom 5 customers based on Margin (default selection) manually"?

    Unfortunately, there is no script method for applying Top N / Bottom N filtering directly on a data source. If your data source is a BEx Query then I would suggest that you create separate Top 5 / Bottom 5 Conditions for Revenue, Margin and Volume in the query definition. You can then activate the required condition by script based on the radio button selection by applying the setMeasureFilterActive() method on the data source.

    Here are some posts that describe the use of BEx Conditions in Design Studio that you may find helpful:

    Working with BEx Conditions in SAP BusinessObjects Design Studio

    Switch BEx Conditions on demand from SAP BusinessObjects Design Studio



    Add comment
    10|10000 characters needed characters exceeded

  • Mar 23, 2017 at 11:38 AM

    Hi Sumit,

    For implementing Top/Bottom 5 Customers, Please check the below code

    DS_1.getMembers(dimension, maxNumber)

    var P= DS_1.getMembers("dimension", 10); 

    And for changing the key figure dynamically, Please check the below link,



    Add comment
    10|10000 characters needed characters exceeded

    • Hi Vidhya,

      Thanks for your response.

      I am using CSV data for the prototyping purpose and I know the functionality of how to get this done from BEx.

      However, as per your recommendation let me create another data source for bottom 5 values and confirm on the same. I am expecting that to work..