9 Replies Latest reply on Aug 31, 2013 11:10 AM by philmodjunk

    Simple Find, but I can't get it to work.

    Imre...

      Title

      Simple Find, but I can't get it to work.

      Post

           I'd like to write a script that does two things:

           - omit records that contains the text "awbz" in field "context_name"

           - show only non-unique results in the field Person_id 

           So, I'd like to see records that have nothing to do with "awbz" and that have multiple "hits" for Person_id. 

           (where person_id is not unique)

            

           I am a definite newby, and got this so far:

           Perform Find []

           Find Records | criteria: BE::Person_id:[!]

           Omit Records | criteria: BE::context_name:["awbz"]

            

           I've tried something with constrain found set, but I don't really know what I'm doing. ...And it doesn't work.

           In the attached image you can see "false hits", I don't want to see "Declaratie AWBZ" in here.

           My crappy solution for now, is to delete all AWBZ references en perform the "!" -find.

           Any help plz?

      Schermafbeelding_2013-08-30_om_14.48.17.png

        • 1. Re: Simple Find, but I can't get it to work.
          philmodjunk

               I ran a quick test as I don't normally script finds in this manner and found it was easy to set this up incorrectly. Make sure that you get the results shown in the following screen shot but with your field names in place of mine.

               If your script step is set up exactly like this screen shot but with your field names in place of mine, make sure that the context_name field is of type text and not of type number.

               For a different approach to scripting finds, see: Scripted Find Examples

          • 2. Re: Simple Find, but I can't get it to work.
            philmodjunk

                 Apologies but a goof on my part was compounded by a truly crappy internet connection. It took me a long time to correct the fact that I had the wrong image uploaded in my previous post. If you are monitoring this thread via email, please open the actual thread to see the edited post now in place.

            • 3. Re: Simple Find, but I can't get it to work.
              Imre...

                   Tnx for the fast reply!

                   I'll try it at once!

              • 4. Re: Simple Find, but I can't get it to work.
                Imre...

                     What it does is: perform the fist step, and at the beginning of the second is start all over (so, does a "find all" first).

                     Or so it seems. Because the "show only multiples for Person_id" [!] doesn't show.

                      

                • 5. Re: Simple Find, but I can't get it to work.
                  Imre...

                       Hi Phil,

                       The result is: 

                       - find unique person_id (it does this perfectly)

                       - forget about find unique and just omit awbz in context_field

                        

                       Somehow the second search dismisses the first.

                  • 6. Re: Simple Find, but I can't get it to work.
                    Imre...

                         These are my fields.

                         Perhaps you could get me going with the proper approach to scripting find-requests. 

                         I've looked over the examples in your link, but it does not combine find&omit. There's the tricky part I guess.

                    • 7. Re: Simple Find, but I can't get it to work.
                      philmodjunk

                           When I test this on my sample file, it works perfectly.

                           What I see in your screen shot would seem to be correct results if the cases where you are seeing a single record was a case where you had two records with duplicate IDs, but one of the records had awz. In that case the first request finds all the duplicates, but then the omit request drops out the awz record--leaving behind what is now a single record with that ID as the other record was omitted.

                      • 8. Re: Simple Find, but I can't get it to work.
                        Imre...

                             Hi Phil,

                              

                             I think, because of a little language barrier -I'm dutch-, I have not been clear.

                             Let me rephrase my question:

                             I have a database with Person_id's and context_names

                             A person can have multiple context_names

                             I want to see all persons with more thant one context_name, not counting context_name "awbz".

                              

                             Example: Person_id = 1, context_name="DBC" and context_name="Aanmelding" - I want to see this.

                             Example2: Person_id = 2, context_name="DBC" - I don't want to see this

                             Example3: Person_id =3, context_name="DBC" and context_name="AWBZ" - I don't want to see this.

                              

                             The script I used soo far does not do the job. Can you help me?

                        • 9. Re: Simple Find, but I can't get it to work.
                          philmodjunk

                               Ok, then your find script is working as it is designed to do. It just isn't producing the results that you expected. That is what I explained in my last post.

                               I don't have time to test this at this time, but the following may work:

                               Show All Records
                               PerformFind [Restore]---just one request to omit awbz
                               Constrain Found Set [Restore] ---Specify duplicates in the id field