2 Replies Latest reply: May 15, 2014 9:52 AM by MorseB _ RSS

    Open Multiple Files Using Code

    MorseB _

      Is there a way to easily open multiple files using the openfile command?  I want to open two report files run at different times and compare the activity between them to derive the different records.


      Will openfile = .... then openfile = .... work?


      Also, is there a way to filter out the duplicates?

        • Open Multiple Files Using Code
          Data Kruncher

          Hi Beth,


          The command you'll use is SetReportFile. This command sends a value back to your program indicate whether it was able to load your report (TRUE) or not (FALSE).


          So what you want to do is something along the lines of:

          [font="courier"]openfile = objMonarch.SetReportFile("C:FirstFile.txt",False)

          openfile = objMonarch.SetReportFile("C:SecondFile.txt",True)  /font[/quote]This will load both reports simulatenously.


          As to how to filter duplicates, I'd use the count field in a summary. You can build a summary with the key field values you expect to see only once in each report. Then on the Matching tab for the key field, set it to Measure on the count field, where the value is at most 1. This will eliminate the duplicates. You can often include every field from your report in the summary definition, basically a mirror of the Table view.


          You'd then have all the data for those unique records, filtering out the duplicates.


          How does that work for you?



          • Open Multiple Files Using Code
            MorseB _

            Is there a way to exclude both records, i.e., both pairs of the duplicates?