8 Replies Latest reply on Mar 22, 2010 8:39 AM by FrankRizzo

    Export records script based on the criteria of 2 fields

    FrankRizzo

      Title

      Export records script based on the criteria of 2 fields

      Post

      Apologies if this is not the right thread to be in...?

       

      I have inherited a database that I need to do a job on.  I have listed the 2 tables/fields that are the focus.  They are not relational...

       

      table 1 

      field- item's monetary amount

      field- Item's purchase #

       

      table 2

      field- item's description

      field- item's purchase #

       

      the script needs to find records with a monetary amount  field > $500 in table 1.  

      if found, and the item purchase # matches in both tables, a list of those exported records is the desired goal.

       

      *it seems that the field- item purchase # should be global but it is not right now.  

       

      Thank you

        • 1. Re: Export records script based on the criteria of 2 fields
          philmodjunk

          FrankRizzo,

           

          This really would be better posted as the start of a new thread as it doesn't appear to have much to do with this forum topic. If you'd like, I can move your post so that it starts a new discussion.

           

          A little more info about your two tables would help.

           

          I don't see anything that's "exported" here.

           

          You say "They are not relational...", but it would appear they should be linked by Purchase # in a relationship.

           

          Also, you might want to check this thread: http://forum-en.filemaker.com/t5/Using-FileMaker-Pro/When-requesting-assistance-on-this-forum/td-p/34059

          • 2. Re: Export records script based on the criteria of 2 fields
            FrankRizzo

            any help is always appreciated.  please move the post, thank you.  i assumed that purchase # should be relational.  will making it relational butcher the the data by creating duplicate content?  if i am worthy of more charity, what else can i convey about the tables, fields, etc?  i wanted to make the post request as short as possible.

             

            Thanks

            • 3. Re: Export records script based on the criteria of 2 fields
              philmodjunk

              Feel free to use the edit option to change the subject line to something that better describes your issue. That's something you can find in the options menu in the upper right corner of your posts.

               

              "will making it relational butcher the the data by creating duplicate content?"

              Simply linking the data by this field won't alter your existing data. It'll just give you new ways of viewing and working with the data. You can try it and see what happens. (While this is safe, It's always a good idea to make frequent back up copies of your file while working with it.)

               

              "i wanted to make the post request as short as possible."

              Succinct, structured posts are very welcome. Deciphering long drawn out descriptions that are run together into one big block of text is a major headache. Incomplete posts, however, just leave people in the dark as to what you really need.

               

              From what you've posted so far, I have only a very limited idea of what you want to do.

              • 4. Re: Export records script based on the criteria of 2 fields
                FrankRizzo

                table 1 

                field- item's monetary amount

                field- Item's purchase #

                 

                table 2

                field- item's description

                field- item's purchase #

                 

                i need to script a find and export

                 

                if the monetary amount in the field of table 1, is greater than $1000 and the purchase # matches table 2's purchase #, i would like to export all records that meet that criteria.

                 

                Newb is my middle name, so i beg a 1000 pardons.  I have related the purchase # between both tables.  my scripting knowledge is limited though.  So i am assuming that i should script a search before i can export what i want.  My limited knowledge figured that i should use my purchase # field as a global variable, but i have no clue.  Have i mentioned enough for the means to help me?

                 

                 

                • 5. Re: Export records script based on the criteria of 2 fields
                  philmodjunk

                  Exporting from what source (table 1 or table 2?)  to what destination?

                   

                   

                  "if the monetary amount in the field of table 1, is greater than $1000 and the purchase # matches table 2's purchase #"

                  Do you mean:

                  1) find all records in table 1 with amount greater than $1000.

                  and

                  2) for each such record whose Pruchase # matches the purchase # of a record in table 2, export it.

                  • 6. Re: Export records script based on the criteria of 2 fields
                    FrankRizzo

                     


                    PhilModJunk wrote:

                    Exporting from what source (table 1 or table 2?)  to what destination?

                     

                     

                    "if the monetary amount in the field of table 1, is greater than $1000 and the purchase # matches table 2's purchase #"

                    Do you mean:

                    1) find all records in table 1 with amount greater than $1000.

                    and

                    2) for each such record whose Pruchase # matches the purchase # of a record in table 2, export it.

                     

                    ----------------------------------------------------------------------------------------------

                    Oh good, i did not make it sound more convoluted than before.  So for your questions 1 and 2- yes, exactly!  Id like to export  to another layout or to a file.  Either should be fine.

                    Thank You


                     

                     

                     

                    • 7. Re: Export records script based on the criteria of 2 fields
                      FrankRizzo

                      i started a script today and wanted to add to it this evening.  so i searched some more and found this article.

                      http://filemaker.custhelp.com/app/answers/detail/a_id/5822/kw/export

                       

                      i will try to combine that with what i have which involves a "performfind" to export the records i need from table 1. 

                       

                      then i will try to add a second search based on a relationship or portal between table 1 and 2, then export the records i need from table 2.  

                       

                      finally i will merge them in to 1 new export to a layout or table - all wrapped in to 1 script.  or maybe successive scripts?  

                       

                      any structure advice to the script will be much appreciated.

                       

                      thanks anyone who chips in!

                      • 8. Re: Export records script based on the criteria of 2 fields
                        FrankRizzo

                        ok to review

                        2 tables, no relation.

                        How to combine data based on matching a key field, filtering for only certain types of data, and omitting everything else.

                         

                        i called filemaker phone support and opted to pay a flat rate of $45 to get support for setting up an example script.  However, once the technician transferred me- the tech kept saying "no, we dont do that."  "no, you cant do that."  she didnt even want to brainstorm although i clearly told her i was prepared to work with just some guidance. 

                         

                        Toooooo hard for my project all in filemaker. 

                         

                        I wanted to do the equivalent of merging rows in excel.  I tried consolidation, merge, and macros.  finally using macros in excel got what i needed.  lesson here was stop wasting time, cut my losses, and fix the setup of filemaker VS trying to script in filemaker when the set up was not right.

                         

                        now that i got my data how i needed, i can continue experimenting with filemaker.  many thanks to the people who post suggestions here on the forums.  the information from a human is a great supplement to the books.

                         

                        regards,

                        frank