Multi-select default value

(6 posts) (2 voices)

Tags:

No tags yet.

  1. Deepak, Member

    Hi,

    How can we set the default value for a multi-select field?

    When report is clicked i want the multi-select field to be defaulted to 'All'. Below is my parameter query


    CREATE DEFINER=root@% PROCEDURE set1_2_getMajorBrand_test(mydbr_param1 int, mydbr_param2 int)
    BEGIN select 0,'All' as ord2,'','1' as ord1
    UNION
    select dv.major_brand,tm.taxvaldesc as ord2,'','2' as ord1
    from sipo_db.frf_documents fd
    JOIN sipo_db.dnrf_prefixes as dp on dp.id=fd.dnrf_id
    JOIN sipo_db.dnrf_values as dv on dv.id=dp.dnrf_value_id
    LEFT JOIN sipo_db.launch_maps as la on la.frf_id=fd.id
    JOIN sipo_db.launch_maps as la1 on la1.dnrf_id = dp.id
    JOIN sipo_db.tm_m_ibm_taxdtls tm on tm.id=dv.major_brand
    where
    (if(mydbr_param1 <> 0,la.launch_id=mydbr_param1,1=1)
    or if(mydbr_param1 <> 0,la1.launch_id=mydbr_param1,1=1))
    and if(mydbr_param2<>0,dv.business_unit=mydbr_param2,1=1)
    group by ord2
    order by ord1,ord2; END

    If this multi-select is not defaulted to 'all' the subsequent parameter queries returns "No Parameters available"

    Thanks

  2. Deepak, Member

    Hi,

    I have another question related to parameter query.

    Can we pass values from a multi-select parameter query to another pop-up parameter query.
    In my case i have 2 fields Major Brand(multi-select) and Minor Brand(pop up). I want to pass multi-select values from major brand to pop up minor brand.

  3. myDBR Team, Key Master

    How can we set the default value for a multi-select field?

    Multiselect default is a comma separated list of ID values. If you wish to set default for the first option the default is '0'.

    As for the connected parameters, multiselect parameters are not yet supported.

    --
    myDBR Team

  4. Deepak, Member

    Hi,
    Below is the query i use for the mutiselect values, i have 0 assigned to 'all' as default yet the 'All' value is not selected when the multi-select parameter loads.


    select 0,'All' as ord2,'','1' as ord1
    UNION
    select dv.major_brand,tm.taxvaldesc as ord2,'','2' as ord1
    from sipo_db.frf_documents fd
    JOIN sipo_db.dnrf_prefixes as dp on dp.id=fd.dnrf_id
    JOIN sipo_db.dnrf_values as dv on dv.id=dp.dnrf_value_id
    LEFT JOIN sipo_db.launch_maps as la on la.frf_id=fd.id
    JOIN sipo_db.launch_maps as la1 on la1.dnrf_id = dp.id
    JOIN sipo_db.tm_m_ibm_taxdtls tm on tm.id=dv.major_brand
    where
    (if(mydbr_param1 <> 0,la.launch_id=mydbr_param1,1=1)
    or if(mydbr_param1 <> 0,la1.launch_id=mydbr_param1,1=1))
    and if(mydbr_param2<>0,dv.business_unit=mydbr_param2,1=1)
    group by ord2
    order by ord1,ord2;

  5. Deepak, Member

    [url=https://drive.google.com/file/d/0B31Hi1WZa4BBU2FnSVlGZ0U2MWs/edit?usp=sharing][/url]

    Please follow the shared document to get more detailed information about the issue related to set default value and "No Parameter values" issues.

  6. myDBR Team, Key Master

    As said, the multiselect parameter is not supported yet in connected parametets. We can take a look if support for it can be added in the next release.

    As for the code, please note that the multiselect parameter is a string (you are using int in connected parameter). Also, if you use input variable names instead of the old (mydbr_param1, mydbr_param2 method), your code will become easier to maintain. As an example, instead of mydbr_param1 you can use the actual parameter name 'inLaunchId'.

    --
    myDBR Team


Reply

You must log in to post.