Clarity

  • 1.  How to use OR condition in two multi select filter?

    Posted Feb 03, 2016 08:26 AM

    Hi All,

     

     

    I have requirement to add couple of multi select filters in my portlet.

     

     

    Ex: If i select A, B values in filter1 and X, Y values in filter2 then output should fetch all results. Meaning we should be able to fetch filter1 or filter2 data (but not filter1 AND filter2).

     

     

    If i use the below code snippet then portlet is not considering these filters at all and showing the full resultset (Show All data).

     

     

    WHERE ((A.dept_role_id IS NULL) OR (@WHERE:PARAM:USER_DEF:INTEGER:A.dept_role_id:role_vendor@))

    OR ((A.role_cc_id IS NULL) OR (@WHERE:PARAM:USER_DEF:INTEGER:A.role_cc_id:role_cc@))

     

     

    But If i apply additional open and close brace in the condition then portlet is considering the filter condition as AND even though i have written OR in the filter.

     

     

    WHERE (((A.dept_role_id IS NULL) OR (@WHERE:PARAM:USER_DEF:INTEGER:A.dept_role_id:role_vendor@))

    OR ((A.role_cc_id IS NULL) OR (@WHERE:PARAM:USER_DEF:INTEGER:A.role_cc_id:role_cc@)))

     

     

     

     

    Any workaround for this? If any one has already used OR condition in between two multi select filters please share the thoughts.

     

     

    Thanks in advance.

     

     

    Regards,

    Manas



  • 2.  Re: How to use OR condition in two multi select filter?

    Posted Feb 03, 2016 09:00 AM

    Confusion could be to do with the way that "multi-select" filters are converted from NSQL to SQL?

     

    Perhaps try "Preview"-ing your NSQL query and then look at the generated SQL to see if it still 'makes sense' for those filter fields?