Skip to Content

Crosstab filter while drilling the data

Dear Experts,

I am trying to apply to a filter on crosstab data. My first column is a customer and I have also enabled the drill on customer.

The drill path flows as follow: Customer> Region>Country

There is also a chart in the dashboard with data source DS_2 which is showing the values for Year wise Volume, Revenue and margin data in 3 different bar charts

When I use the following code: DS_CHART.setFilter("Customer", CROSSTAB_1.getSelectedMember("Customer")); and disable the drill it works fine and I am able to filter the data of the chart based on row selection in crosstab. But when I enable the drill for Customer, the filter stops working. This is the code for the Customer drill in crosstab.

DS_CROSSTAB.swapDimensions("Customer", "Region");

DS_CROSSTAB.swapDimensions("Customer", "Country");

Kindly advise.

Regards

Sumit

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Feb 08, 2017 at 04:40 PM

    Hi Sumit,

    Please try the following script. It should work you you

    Step1: Create a global script variable

    Step 2: Crosstab Script

    if (level==true)

    {

    var b = CROSSTAB_1.getSelectedMember("Customer");

    DS_2.setFilter("Customer", b);

    DS_CROSSTAB.setFilter("Customer", b);

    DS_CROSSTAB.removeDimension("Customer");

    DS_CROSSTAB.moveDimensionToRows("Region");

    }

    if (level==false)

    {

    var a = CROSSTAB_1.getSelectedMember("Region");

    DS_2.setFilter("Region", a);

    DS_CROSSTAB.setFilter("Region", a);

    DS_CROSSTAB.removeDimension("Region");

    DS_CROSSTAB.moveDimensionToRows("Country");

    level= true;

    }

    Add comment
    10|10000 characters needed characters exceeded