Category Selector Like

1938
9
01-08-2018 08:50 AM
MeleKoneya
Regular Contributor

I would like to use the category selector on a string field and use a Like Operator.     It does not look like this is possible.  I am trying to create a drop down category selector to filter hydrants by the shift(A,B, or C) they are assigned to for flushing.   

The field containing the Shift has the station number and shift (ex 601A).

The Feature Layer I am using is coming from ArcSDE on our internal ArcGIS Server and I would rather not have to add a field.    One idea I had was to add a table with just the shift (A,B, C) and join it to the ArcSDE Feature Class.

Am I missing something here?    If not,   anyone figured out a work around?     

Thanks,

Mele

Tags (1)
9 Replies
DavidNyenhuis1
Esri Contributor

Hi Mele Koneya‌,

If I understand you correctly, you can use a LIKE operator on a category selector by changing the Selection property to Multiple. In the interface we call the LIKE operator "Include". After choosing Multiple, the Operator property will change to include. This will allow you to "include" one or multiple values in the WHERE clause generated from the category selector. Please let me know if this answers your question.

MeleKoneya
Regular Contributor

David,

Thanks for the response.    I had done what you are suggesting on another layer,  but I think the issue I have is related to another post I made 

https://community.esri.com/thread/207455-operations-dashboard-map-actions-does-not-zoom 

I guess the operation I would like is for the Selector to select all the "A Shift" hydrants as one group and not the individual hydrants.    I had a work around for the Zoom issue that I think I can apply to this as well. 

Mele

0 Kudos
MassimilianoMenestrina1
New Contributor

Hi David Nyenhuis‌, we are using ArcGIS Enterprise 10.6.1 and we are facing a similar problem.

When changing the selector modo to multiple, the option 'INCLUDE' appears but it works as if it were an EQUAL operator, not LIKE

When we debug the query that the Dashboard make to the server, it confirms our suspicions, a = operator is used in the query.
Is it a known issue?

Is there a Patch or Service Pack to solve it?
Thanks in advance

Massi

Selector configurationQuery made

AllenDailey1
Occasional Contributor

I have a very similar question as Massimiliano Menestrina‌ above.  

In my operations dashboard, I have a dropdown category selector to allow the user to choose a department and filter what shows up in the list (items in the list should include the chosen department).  The problem is that the items in the list are surveys completed via Survey123 and the survey field connected to the dashboard category selector can contain multiple departments. 

So, for example, if the user selects the department "Sheriff" from the dashboard dropdown, the list filters to display only surveys that list Sheriff ONLY, and the list does not display surveys where a user may have included Sheriff as well as another department like Social Services.  I need the list to display surveys/items where the relevant field CONTAINS the chosen department, not strictly EQUALS the chosen department.  All I'd need is for the "=" operator to change to "is in" or something.  Does anyone know how to accomplish this?

This screenshot shows an example of that in the last item in the list - notice it contains two departments for "Referred to."

Next, notice that when "Social Services" is selected in the "Department" category selector dropdown, the list item/survey that was the last one in the above screenshot is NOT included in the filtered list, but I need it to be included!

Thank you!

Allen

0 Kudos
EllenLester1
New Contributor III

I am trying to do the same thing. Users submit data in a Survey123 and one of the resulting fields contains one or more departments. I need to be able to filter the dashboard to show any data where the department is contained in that field, whether it's the only department or one of many. Has anyone found a way around the limitations described in previous posts?

0 Kudos
AllenDailey1
Occasional Contributor

Hi Ellen,

I did come up with a workaround.  I am quite happy with it, but it would not be ideal if you want users to select from a really long list of departments or whatever.  Here's how it works:

  1. I changed the survey question where the user could select multiple departments: I changed it into a separate question for each department.  That is, the questions are now like: "Notify Social Services? yes/no.  Notify Public Works? yes/no." etc.  (Each of those is a select_one yes_no question.)
  2. Then, in the dashboard, to allow the viewer to choose a department for filtering the dashboard content, I created a separate category selector widget in the header (or sidebar) for each department/question.  
  3. I configured the category selectors thus: categories from defined values; I typed the department name instead of "yes" or "no"; I did not type anything for "label"; I chose "button bar" display; no "none" option; I used "select multiple" (so the button for the department name would not be automatically selected).

After doing all that, I have a button for each department, and I configured actions so that the buttons affect the other dashboard widgets.

I'd be interested to hear if you or anybody else finds this useful!    Good luck!

Allen

EllenLester1
New Contributor III

Allen,

Thanks for sharing this workaround! I finally had a chance to try this today and it works pretty well! (Although I still hope Esri changes this in the future to make things easier for us.) My department list was really long, so creating a question for each department would have taken up a lot of space in my survey. Fortunately, my survey is based off an existing feature service (table is in a SQL database) and I was already using a database view to add some extra info for my dashboard. So, I added a few lines to my query to create a column for each department. Below is a shortened example of the query I used.

SELECT *,
CASE WHEN BusinessUnit like '%DepartmentName%' THEN 'Yes' ELSE NULL END AS DepartmentName‍,
CASE WHEN BusinessUnit like '%DepartmentName2%' THEN 'Yes' ELSE NULL END AS DepartmentName‍2
from TableName

From there, I published my database view and set up the buttons as you described. I put them in a slide over side panel since they wouldn't all fit in my header.

Thanks!

Ellen

0 Kudos
AllenDailey1
Occasional Contributor

Hi Ellen,

I'm glad to hear you created a workaround using my method plus your own tweaks.  Sounds good!  Thanks for sharing!

Allen

0 Kudos
MarcCavallaro
New Contributor III

@AllenDailey1  and @EllenLester1 

I'm attempting to implement both of your solutions to allow users to visualize project locations (points) that occur within buildings, but I am still struggling to get a result that allows the users to select multiple building buttons  and have the dashboard display all project results as long as they meet at least one criteria.

I created a sql view that populates a "yes" value into fields (one field per building) when the building value is found within the Locations field (Building 1, Building 2, etc..).  Then setup individual selectors for each building and configured the actions.

Where I am getting hung up is when activating more than one button, it becomes exclusionary. For example many projects may only occur within Building 1, but in some cases some projects span across both Building 1 and Building 2.  When selecting both Building 1 and Building 2, buttons, only results are shown for where that intersection occurs and Building 1 only, or Building 2 only projects are eliminated from display. 

The desired result would be for any projects that = yes for a building are displayed, regardless of the number of buildings they occur in. Essentially in need it to function as an OR not an AND.  The more buttons that are activated the more project locations should be displayed, it should always add, and include projects as long as they meet at least one criteria.

Any insight on how I can achieve this would be greatly appreciated.

0 Kudos