4 Replies Latest reply on Feb 12, 2014 11:03 AM by philmodjunk

    More efficient ways to make graphs?

    melissajaffray

      Title

      More efficient ways to make graphs?

      Post

           I know this is probably a stupid question, but how can I make graphs more efficient? Right now my database has over 11,000 records for items sold and the management are going to want graphs made soon to see how everything is going. The issue is to have the system generate any graph it is going to take forever. I was curious if there was a way to get the total sold for each item at the end of the month and then put it in a field and use that for the graph? Has anyone tried that?

           Thanks for any suggestions!

        • 1. Re: More efficient ways to make graphs?
          philmodjunk

               Every night we have a script that generates new records in a summary table. Each new record stores summary values in a set of simple number fields--one record for each type of line item purchased. This puts data over a 1,000 records into less than a dozen records. We can then generate summary reports (and chart data) from this summary table much more quickly than from the original line items table.

          • 2. Re: More efficient ways to make graphs?
            melissajaffray

                 Thats about what I was thinking. Thanks! Any tips on doing the server side script? All it should be is writing the script and having the server run it at an assigned time right?

            • 3. Re: More efficient ways to make graphs?
              RickWhitelaw

                   i don't see why you would need a server side script for this.

              • 4. Re: More efficient ways to make graphs?
                philmodjunk

                     As server side script would allow you to run the script at a scheduled time each night. In our case, we don't use a server schedule as other parts or the same script--that import records from one FileMaker file to another--are not server side compatible. We use an OS scheduled FileMaker robot file instead.

                     I can provide a basic outline of the script:

                     Loop
                        Perform a find for all records not marked as "summarized".
                        Exit Loop if [ Not get ( foundCount ) ]
                        Constrain the found set to just one group of records that you want to use to compute your summary totals.
                        Use Set variable steps to copy the values of summary fields.
                        Use set variable steps to copy the values of any other fields such as a date and/or category name needed to identify the summary record you are
                                   about to create.
                        Go to Layout based on summary table.
                        Create a new record
                        Use set field steps to copy the data from the variables into fields in the new record
                        Go to Layout [//return to your original layout.
                        Use Replace Field Contents to mark all of these records as "Summarized".
                     End Loop