Skip to Content
avatar image
Former Member

Add/Remove measures at run time to a crosstab component

Hi Experts,

I have a scenario in Design Studio where I need to assign measures at run time to Crosstab component from same data source.

Our BEX query has SalesValue TY, SalesValue LY, SalesQty TY, SalesQty LY measures.

When I select Value from drop down, I would like to display SalesValue TY and SalesValue LY measures in Crosstab component and when I select Qty from dropdown, I would like to display SalesQty TY and SalesQty LY measures from the same source in same crosstab component.

I do not want to have two data sources and two crosstab components and hiding/showing them at run time.

I am able to add dimensions to crosstab component at runtime by using below two methods.

DS_1.moveDimensionToColumns(dimension, position?)


Did any one tried add/remove measures at runtime to Crosstab component? I know we need to filter measures of data source at run time but not finding any suitable methods.

Please guide me.



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jun 08, 2015 at 06:14 AM

    Hi Satyam,

    To be specific, you would need to code the "On Select" event script of the dropdown list to look similar to the following:

    if (me.getSelectedValue() == "V") {

    // Filter Value Measures

      DS_1.setFilter("006EIC2OSTY2YAK2X13HZAWTE", ["006EIC2OSTY2YAK2X13HZB34Y", "006EIC2OSTY2YAK2X13HZB9GI"]);


    // Filter Quantity Measures

    else {

      DS_1.setFilter("006EIC2OSTY2YAK2X13HZAWTE", ["006EIC2OSTY2YAK4A4L7YHZFM", "006EIC2OSTY2YAK4A4L7YI5R6"]);


    In the setFilter() method, the first parameter represents the ID of the Measure Dimension.  The second parameter is an array of the Measure Dimension Member IDs for the Value measures in the first case and Quantity measures in the second case.

    The result is as follows:



    Value.png (229.2 kB)
    Quantity.png (238.7 kB)
    Add comment
    10|10000 characters needed characters exceeded

  • Jun 08, 2015 at 03:51 AM

    Hello Satyam,

    have you considered a filter option and - depending on the option that was selected - to set filters on the measure dimension ?


    Ingo Hilgefort, Visual BI

    Add comment
    10|10000 characters needed characters exceeded