Skip to Content

Design studio setVariablevalueExt multiple values in for Input Parameter


I am working on a Dashboard where I want to filter the resultset by using input parameters. I have a similar setup as described in below link:

How to use multiple values in input parameter

This all works flawless on HANA but the requirement is to use it in Design Studio.

To be able to filter the data I use the .setVariableValueExt

Thing is that whatever I do I am not able to get the right syntax to use that function with multiple values. Like in the example above I would like to filter on 2 regions:

DS_1.setVariableValueExt('REGION', "EMEA'',''AMR")

It just resolves into an error message that the selections are invalid and have been discarded. (which in fact is correct since the concatenation of the 2 different regions are non existent in the data)

The sql on haha side renders fine:

('PLACEHOLDER' = ('$$REGION$$', 'EMEA'', ''AMR')) 

Is there anybody who knows the correct handling of this multiple select...tried searching and tried quite some different scenarios all not ending up in correct results...

The below forum post looks similar but we are on design studio 1.6. And by looking at that post it does look possible to use the .setVariableValueExt with multiple values.

Forum post multiple values setVariableValueExt

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

6 Answers

  • Best Answer
    Dec 30, 2016 at 03:04 PM

    Gert - my sandbox HANA system is down, so I can try this - but could you look at Dmitry's blog here to see if it helps:

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 30, 2016 at 04:29 PM

    Hi Gert Jan Oostrum,

    You have to use semicolon ";" separated values for passing multiple values.

    In your case like DS_1.setVariableValueExt( 'REGION' , "EMEA;AMR;" );



    Add comment
    10|10000 characters needed characters exceeded

  • Jan 01, 2017 at 06:21 AM

    Hi Gert,

    Is there a reason why you specifically need to use input parameters for filtering? Based on the scenario you have described I would have thought it would have been simpler and more efficient to apply a setFilter() on the Region dimension in your HANA view.



    Add comment
    10|10000 characters needed characters exceeded

  • Jan 02, 2017 at 09:10 AM

    Hi all,

    @Tammy, I tried the setup as mentioned in the blog. That works out fine (the loop and create the filterstring to use in setVariableValueExt) but still ends up in the error message in the end about the selection:

    @Poovarasan, I also tried the option with the semicolon. The input parameter is applied correctly but having the same error message as above.

    @Mustafa, I have used input parameters for this specific scenario because I cannot use the regular filters or variables. The dimensions needed for filtering are only available in the lower levels of my calculation view. By using the input parameters I can hand them over from the frontend to the level in the calculation view where I need to filter the data to influence the totals at the top.

    region-error.jpg (33.1 kB)
    Add comment
    10|10000 characters needed characters exceeded

  • Jan 02, 2017 at 12:16 PM

    I have identified the discrepency. I have used an input parameter of type column. This was because I would like to generate a list of values based on another View. I have made a new test by using input parameters of type direct. In this case I cannot generate a LOV but I will figure something else for that :-)

    I also noticed that the syntax which is required is similar as the syntax in the sql on HANA side.

    So the actual string to push into the setVariableValueExt is:

    EMEA'', ''AMR

    a comma seperator and double apostrophes.

    By implementing some minor tweaks to the script of Dmitry which Tammy hinted, my testcase now works ok:

    var fltrstr = DS_1getFilterExt("REGION"); //Get selected values 
    var var_marray = fltrstr.split("; "); //Spliting var var_mstr = ''; //Val variable
    var_marray.forEach(function(element, index) {
    if (element.substring(0,1) == "!") {
    var_mstr = var_mstr + element.substring(1) + "'',''";
    } else {
    var_mstr = var_mstr + element + "'',''" ;
    var_mstr = var_mstr.substring(0,var_mstr.length-5); //Cut extra “”'',''””
    //All values
    if (var_mstr == "") {var_mstr = '*';
    //Update available filter values
    DS_2.setVariableValueExt("REGION_SELECTION", var_mstr);
    TEXT_1.setText(var_mstr); //to check the filter

    I applied the script in the on apply of the dimension filter and now it filters the second Datasource (DS_2) based on the region selections made on the other Datasource DS_1

    Thanks all for your thoughts.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 09, 2017 at 06:23 AM

    Hi Folks,

    I am trying to pass multiple values as filter in a data source and using below code for the same.

    v_value = "value1;value2;value3,value-4,value5;"

    DS_1.setFilterExt("ZCAT3", v_value);

    when executing this code, am getting value6 and value7 also. Upon analysis I found out that "-" in value-4 is causing this issue. Whenever there is a special character "-" or "/" in the value setFilterExt doesn't work properly. This might be a product bug.

    I tested this behavior with SAP Design Studio 1.6 SP02 with BI Platform 4.2 SP02.

    Anyone work around here??


    Add comment
    10|10000 characters needed characters exceeded