View Only
  • 1.  Multi Select Filters on Portlet

    Posted Sep 12, 2013 08:55 AM
    I know these are possible, but with my Portlet, I don't see any options to make my "resource" filter a multi-select filter.

    Would it be related to how I've written my NSQL? I'm using the Lookup "Resources For Search" for this filter.

    AND (@WHERE:PARAM:USER_DEF:STRING:ResourceIsActive@ = 'All' OR @WHERE:PARAM:USER_DEF:String:ResourceIsActive@ = A."ResourceIsActive")
    AND (@WHERE:PARAM:USER_DEF:STRING:ProjectIsActive@ = 'All' OR @WHERE:PARAM:USER_DEF:String:ProjectIsActive@ = A."ProjectIsActive")
    (SELECT 1 FROM prj_obs_associations ASSOC, prj_obs_units_flat FLAT
    WHERE A."" = ASSOC.record_id AND ASSOC.table_name ='SRM_RESOURCES'AND ASSOC.unit_id = FLAT.unit_id AND FLAT.branch_unit_id = @WHERE:PARAM:USER_DEF:INTEGER:Dept@))

  • 2.  RE: Multi Select Filters on Portlet

    Posted Sep 12, 2013 09:24 AM
    The simplest way to do this is to NOT use a "user parameter" field as the filter (i.e. your @WHERE:PARAM:USER_DEF:INTEGER:UserID@ field, which becomes param_userid in the query attributes), but just return the "user_id" in your list of fields retrieved by the query (i.e. a "normal attribute") and then associate the lookup with that "normal attribute" and put it in your filter section. Clarity should then let you define that as multi-select.

    We can get multi-select to work against those param_ type filter fields, but its a bit tortuous to explain how (there are some threads on the board about it so even if you ask how to do that I will just tell you to find those threads!)


    In general, its much simpler (and better) to see if you can return your "filter field" in the query (realising that you don't want to display it in the final portlet) and then use that field in the filter section - rather than building in user parameter fields (there are use-cases when you just can't do that because of how you want the filter to work (the OBS hierarchical search is an example), but in simple cases this is much easier to build and then maintain since you don't have to write any NSQL logic to support itl)

  • 3.  RE: Multi Select Filters on Portlet

    Posted Sep 17, 2013 08:20 AM

    Dave's suggested option is probably the simplest approach which works. Or if you insist on using Multi-select Parameter - try this

    AND ((a.user_id IS NULL) OR (@WHERE:PARAM:USER_DEF:INTEGER:a.user_id:user_id@))