7 Replies Latest reply on Aug 21, 2012 8:16 AM by tech_liaison

    Constrained Finds

    Greg

      Good Day All,

       

      FMP PRO ADV 11

       

      I am having a heck of a time getting my head around this. I am trying to Script a Search to do the following

       

      Here's the deal. I do a date range search and find 1400+ records OK

      I now want to find how many of the 1400+ records meet 4 possible criteria.

       

      This is an OR search in that either Safety OR Coutesy OR Experience OR Efficiency could be selected and it's possible more than one could be selected.

       

      The end result could be 5 Safety, 25, Courtesy, 50 Experience, and 30 Efficiency so I would now hve a Found Set of 110 Record out of the original Found Set of 1400+ Records.

       

      The Script is as Follows:

       

      Show All Records

      Goto Layout ["Maager Responses" (ccc)]

      Enter Find Mode (Paise)

      Perform Find [] This is where the 1400 Records are found

      Enter Find Mode []

      Modify Last Find

      Constrain Found Set [Restore] This is where the 5 Safety are found

       

      Repeated for each addition Constraint

       

      There may be a much easier way to do this or I may just be way off base.

       

      Any advice will be very much appreciated and Thanks in Advance...

       

      greg

        • 1. Re: Constrained Finds
          comment

          Try something along these lines:

           

          Go to Layout [ YourTable ]

          Enter Find Mode []

          Set Field [ YourTable::DateField ; ... ]

          Set Field [ YourTable::Type ; "Safety" ]

          Duplicate Request

          Set Field [ YourTable::Type ; "Courtesy" ]

          ...

          Perform Find []

           

          If you have a list of  types to search for, the duplication could be automated in a loop

          • 2. Re: Constrained Finds
            Greg

            Thanks I'll give a try.

             

            One questioon would be the First Find for Date.  It is a renge say for the Month of July etc so I may leave the way it is but do the rest as you suggest.

             

            greg

            • 3. Re: Constrained Finds
              ariley

              Perhaps you could try creating a subsummary report that summaries the records below them. Or if you just need to see the numbers, you don't even need to see the records, you can leave the "body" out of the report.

               

              Another method to this madness is introducing an interface table to your solution where you crate  some global fields, 4 to be correct to match your 4 criteria and connect the table where your records live.

               

              Create two global date fields, as well, for your date range and place them on your new Interface layout.  Then you an show 4 portals on your layout from Interface with your records for each criteria and all you have to do is modify your date range.

               

              Again, if you don't want to see the records, you can just add up their ID count in the interface table based on the table occurrences.

               

              I do these kinds of things on dashboards.

               

              agnes b. riley . filemaker and web development

              www.zerobluetech.com

              T 201-299-6223 (NJ) . 212-842-8830 (NY) . 917-660-7221 (C)

              FileMaker Certified in 10 and 11

              • 4. Re: Constrained Finds
                Greg

                Thanks again Michael,

                 

                Your suggestion as I undestand does not get what I need.  I can find 1427 records by date range but nowhere trying set field method for the 4 Catagories.  I may be doing something wrong.

                 

                greg

                • 5. Re: Constrained Finds
                  Greg

                  Good Morning Agnes,

                   

                  I alrady have sub summary reports showing number of times a catagory is selected etc.

                   

                  What I am trying to do is create a List of Customer Comments based on the 4 Criteria I decribed/

                   

                  So out of 1427 Comment Cards submitted I need to find the ones that have had 1 or more of the Catagories Taged.

                   

                  These Commets can then be reviewed and actions taken based on the 4 Catagories.

                   

                   

                  greg

                  • 6. Re: Constrained Finds
                    comment

                    Greg wrote:

                     

                    I can find 1427 records by date range but nowhere trying set field method for the 4 Catagories. 

                     

                    The Set Field[] is not essential here - it's simply easier to see what is being done than using [Restore]. The important thing is to end up with as many requests as the number of categories you want to find. Each request searches for the same date range and for one category.

                    • 7. Re: Constrained Finds
                      tech_liaison

                      Yes, you create OR finds by using multiple requests as Michael mentions, but you can specify those multiple requests within the Constrain Found Set > Specify Find Requests dialog like so:

                      Specify Find Requests.png

                      So your first Find is going to find the date you want, and the Constrain Found Set [Restore] step is going to do an OR constrain based on the four requests it encapsulates. HTH.