Skip to Content
avatar image
Former Member

GET MEMBERS FROM FILTERED DATA SOURCES

Hi everyone,

At the beginning of the report I would like to see all the values of the Checkbox group with some of the options being checked.

I expect that, checked item will change according to the selected year.

My dataset include budget versions that change according to years.

Year version

2017 2017-A

2017 2017-BV1

2017 2017-BV2

2017 2017-BV3

2016 2016-A

2016 2016-BV1

2016 2016-BV2

First, I filter the data source with the following script on the radio button select event.

DATA_SALES_UNIT_MTD.setFilter("_wVTG0HHZEeeYI-Qg6aRcTA", RADIOBUTTON_FIL_YEAR.getSelectedText());

For example, I chose 2017 from RADIO BUTTON

Then I would like to bring all versions into the checkbox group but only the 2017 versions should appear marked

with the following script, but all come with a selection.

var request = DATA_SALES_UNIT_MTD.getMembers("VERSION_DIM", 100);

CBG_VERSION.setItems(DATA_SALES_UNIT_MTD.getMemberList("VERSION_DIM", MemberPresentation.INTERNAL_KEY, MemberDisplay.TEXT, 100));

var selections = [""];

selections.pop(); request.forEach(function(element, index) { selections.push(element.internalKey); });

CBG_VERSION.setSelectedValues(selections);

Design Studio 1.6 SP1

Source: Universe

Many thanks,

Adem

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Nov 17, 2017 at 10:48 AM

    Hi Adem,

    Due to the way cascading filters work, for your requirement you need to create two separate data sources assigned to the SAME Universe. The steps are as follows:

    1. Create a duplicate of your data source DATA_SALES_UNIT_MTD and call it DATA_SALES_UNIT_MTD_FILTERED;

    2. In the data source initial view for DATA_SALES_UNIT_MTD_FILTERED, place the "_wVTG0HHZEeeYI-Qg6aRcTA" dimension in the Rows panel and set the Members for Filtering setting to "Only Values with Posted Data";

    3. Bind the Items property of RADIOBUTTON_FIL_YEAR where:

    Source Data Source = DATA_SALES_UNIT_MTD

    Source Dimension = _wVTG0HHZEeeYI-Qg6aRcTA

    Follow Filter State = true

    Target Data Source = DATA_SALES_UNIT_MTD_FILTERED

    Target Dimension = wVTG0HHZEeeYI-Qg6aRcTA

    4. Bind the Items property of Checkbox Group CBG_VERSION where:

    Source Data Source = DATA_SALES_UNIT_MTD

    Source Dimension = VERSION_DIM

    Follow Filter State = false

    5. In the "On Select" event of Radio Button Group RADIOBUTTON_FIL_YEAR apply the following script code:

    var mySelection = DATA_SALES_UNIT_MTD_FILTERED.getMembers("VERSION_DIM",100);
    
    var mySelectedBudgetVersions = [""];
    mySelectedBudgetVersions.pop();
    
    mySelection.forEach(function(element, index) {
      mySelectedBudgetVersions.push(element.internalKey);
    });
    
    CBG_VERSION.setSelectedValues(mySelectedBudgetVersions);
    

    Regards,

    Mustafa.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 31, 2017 at 09:29 PM

    Hi Adem,

    I suspect the same behavior. Please see below screenshot:-

    I tried few tricks before i could make up my mind and make a change at query level (Bex-Query Designer). Both below tricks didn't work, therefore i applied filter at bex level, since my requirement is different and i can live with those query hard-coded filters for now.

    1. Background Filter (Edit Initial View)
    2. On Result Set Changed (DS property)

    Possible Fix?

    Try creating a variable for "Date Object" and then use DS_1.setVariableValueExt(variable, value).

    This will submit back the query and execute it again.

    Regards,

    Fahad

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 15, 2017 at 02:17 PM

    Hi Adem,

    do you set "only values with posted data" for the dimension "VERSION_DIM" in the Initial View?

    regards,


    Giulia

    Add comment
    10|10000 characters needed characters exceeded