AnsweredAssumed Answered

How do I script a find so that I can constrain a found set with a find that looks for multiple criteria in the same field?

Question asked by ljensen1 on Apr 20, 2018
Latest reply on Apr 21, 2018 by krheinlander

How do I script a find so that I can constrain a found set with a find that looks for multiple criteria in the same field.  I need to allow users to filter data in a variety of ways.

 

I'll give a simple example that uses just some of the possible criteria.  There are three "search" fields: college, degree and major.  The user sees a checklist of five colleges, a checklist of four degrees and a checklist of ten majors.  Every time a box is checked, the found set is constrained by the selection.  The tricky part is that the user can select more than one value for each field.

 

In this example, the user first checks off two colleges.  A scripted find uses an "and" search to find all students with one of the two colleges.

 

Next, the user checks off two majors.  This is the script step I am having trouble with.  I want to constrain the found set by finding students with either of the two majors. If I use the constrain find step with one of the majors, that eliminates records with the other major from the found set.   If I extend the found set with students who have the second major, that can draw in students who have that major, but also have a college other than the selected two colleges.

 

With this simple example, I could script an "and" find that includes each possible combination (i.e. college1/major1; college2/major1; college1/major2; college2/major).  However, in the real application, there are many criteria possibilities, and the number of combinations quickly becomes incredibly high.

Outcomes