Skip to Content
avatar image
Former Member

Dimension filter to filter a non binded data source

Hi,

Overview

I want the selection from a Dimension filter to filter a non binded data source, but I cannot get it working and I’d appreciate assistance.

Situation

DS_1:

  • dimension_A
  • dimension_B

DS_2:

  • dimension_B
  • Note: dimension_A cannot be included in DS_2 query

Dimension filter data binding:

  • Source: DS_1
  • Dimension: dimension_A

Question

When dimension_A value(s) are select from the Dimension filter, I want DS_2 to be filtered based on the dimension_B value(s) associated with each dimension_A value(s) selected.How do I achieve this?

At the moment the On Apply script of the Dimension filter is as follows:

var
dimension_B_List_Array = DS_1.getMembers("dimension_B_id", 1000);

var dimension_B_List_String
= "";
dimension_B_List_Array.forEach(function(element, index) {
dimension_B_List_String = dimension_B_List_String + element.externalKey +
",";
});
DS_2.setFilter("dimension_B_id", dimension_B_List_String.split(","));

However, dimension_B_List_String variable contains all dimension_B values for all dimension_A values, not just the dimension_B values for the dimension_A values selected in the Dimension filter.

I’d appreciate assistance with getting my desired outcome.

Design Studio 1.6 SP3

Source: Universe

Thanks.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Oct 19, 2017 at 04:59 AM

    Hi Greg,

    Try replacing your entire script code above with the following line of code:

    DS_2.copyFilter(dimension_B, DS_1, dimension_A);

    Regards,

    Mustafa.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Oh nice one Mustafa.

      The cascading prompt on DS_1 was the missing link for me. That, and your simplified script, did the trick.

      Thanks

      Greg