Skip to Content

Problem with Component or missing any settings

I have a Problem with my listBox OutPut Display in Design Studio 1.3:

Have Two Data source:

  1) DS_1 for Dimension Filter

  2) DS_2 for ListBox

Bex Query DS_1 has fields/columns like Country key and Country Name of Member Array Type

Another Bex Query DS_2 has fields/columns like Country key, Country Name(Member Array) , State Names(Member Array)

Now when i select single/multiple member items from an Country Dimension Filter, Iam trying to display the selected countries and each country with required Statenames in my listBox OutPut Display. For this i tried so far with the below lines of code in script of Dimension Filter which was not displaying as expected.

   var Countries = DS_1.getFilterText("YCoun");

        var aCountry = Countries.split(";");

               

                   aCountry.forEach(func(country, i){

                         

                    LISTBOX_1.addItem("" + i, country);

                     var aState=DS_2.getMembers("YStat", 10);

                       aState.forEach(func(state) {

                         LISTBOX_1.addItem(state.internalKey, state.text);

                          DS_2.setFilterExt("YCoun", Countries);});});

Tried searching the entire forum if for any two datasources settings needed in dimension filter and refering the documentation didnt get any clue so far.

Any ideas? is this default behaviour in Dimension Filter or am i missing something wrong on the code mentioned above.

Thanks so much

- Dinya.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Jan 08, 2015 at 06:21 AM

    Hi,

    You don't need different datasources for 2 dimensions .

    In Your Data Source DS_1 ( Edit Initial View )

    Right Click on State Column --> Members for Filtering --> With Posted Data .

    Then Try the Code Below .

    var Countries = DS_1.getFilterText("YCoun");
    
    var aCountry= DS_1.getMembers("YCoun");
                           aCountry.forEach(func(country, i){
                           LISTBOX_1.addItem("" + i, country);
                          });
    
    DS_2.setFilterExt("YCoun", Countries)
    
    // Once this is filtered only members in state are those which belongs to respective countries
    // (selected in Dimension Filter ).
    
    var aState=DS_2.getMembers("YStat", 10);
    aState.forEach(func(state) {
    LISTBOX_1.addItem(state.internalKey, state.text);
    ;});                     
    
    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Din 44

      Hi,

      In Initial View .

      Right Click on State Dimension --> Member For Filtering --> Values with Posted Data .

           //On Apply Event of COUNTRY DIMENSIONFILTER :  
      LISTBOX_STATE.removeItems(); // Remove All Items .
      LISTBOX_STATE.setItems(DS_1.getMemberList("STATE", MemberPresentation.TEXT, MemberDisplay.TEXT, 100)) ;