5 Replies Latest reply: May 15, 2014 10:02 AM by smili _ RSS

    Multiple Models in One Project

    MarkAtLMFJ _

      Morning All -


      At my company, for some reports, I have 3 or 4 models which have various summaries on them.  I have different models because I need data captured and computed different ways for viewing data that I have not been able to get to work properly with one model.   I have finally gotten around to exporting the summaries "automatically" via Projects but have multiple projects now instead of multiple models; the input report is all the same. 


      Is there any way, in a project, to open multiple models for the same input report and have all of the summaries from be able to export from one project?


      Mark @ LMFJ

        • Multiple Models in One Project
          Data Kruncher

          Hi Mark,


          No, you can't associate more than a single model with a project, but it's a pretty straightforward exercise to string together a handful of project exports with a batch file, especially as you've already built the project files.


          If you want to run all of the predefined exports for every project (even if there's one defined), all you really need to specify in the batch file is the Monarch path the /prj parameter and a /pxall for each of your project files.


          Running the batch file will get the entire exporting task done for you, hands-free, while you're off getting a fresh coffee or something.

            • Multiple Models in One Project
              smili _

              Hi all,   long time Monarch user, but my first post here.  I just found this forum via a websearch and while waiting for activiation enjoyed reading through some of the threads.


              I have what I'd refer to as a "macro" type problem that I've run into that's similar to the question above and was wondering if there's further info to link to regarding the batch files mentioned above or different way of approaching.


              My company has an older version of Monarch (5.02), and what I'm trying to do is essentially open 30 report files (@600 meg of data) and then have the macro:

              1) open model A, export results to modelA.csv

              2) keeping same report files, open model B, export results to modelB.csv

              3) etc, up through model E.


              Essentially I have large and "messy" files I'm working with and the best I could do in extracting all the data I need each month is using 5 different models.  Macro functionality would seem to be helpful if possible.


              I'm currently running through 5 years of monthly data and it'd save alot of keystrokes if I could make it loop as above, especially given the amount of time it takes to crank through the largish datasets for each month.  (It takes just long enough for me to forget what I was doing  ).  It's really not a big deal once I'm caught up and can do this monthly, but building up the historical archive is kindof slow right now.


              I searched the program help for macro but nothing turns up.  Is what I'm trying to do "doable" or called by a different name?  Appreciate any tips.


              thanks in advance for ideas.

                • Multiple Models in One Project
                  Grant Perkins

                  Hello smili and welcome to the forum.


                  There are batch file abilities with V5 and as far as I can recall there should be some information in the Help using the term 'command' rather than macro.


                  You may also find reference to 'Autoscript' but I would imagine that your PC operating system may be newer than you Monarch and therefore will offer batch file support.


                  Chapter 8 of the Help for the Command related stuff and Chapter 9 if you wish to look at OLE automation.


                  However the opportunities open to you would be greatly improved with a later version of Monarch.


                  You have a large file (in effect) to process and that offers more than one opportunity for things to exceed V5 capacities as well as being not the fastest activity.


                  There may be ways around that in the batch files by processing one file/one model at a time (leaving the batch to do the work) and then concatenating the results to a single file at the end. No doubt my forum friends who code will suggest some simple VB code or similar to make that easier!


                  On the other hand later versions of Monarch introduced the ability to process and APPEND new exports to existing files and it occurs to me that this would be a useful facility to have both for creating the historically oriented files and for future updates to the archives.


                  You may also find that the many new features introduced since V5 would be useful for youe analysis - though there is still the possibility that if your reports are really messy you may still need the multiple passes - just that they would be easier to set up and manage.


                  So far a rather general answer but see where it gets you to start with. Things can always get more specific if they need to.







                  • Multiple Models in One Project
                    Data Kruncher

                    Hi smili, and welcome to the forum


                    I'm sure that you'll be able to do what you want, with a little research and a little creativity. You're definitely on the right track.


                    The following is from a batch file based on a long-ago post by Nick Osdale-Popa. It demonstrates how you can loop through the files in a folder. It's not quite what you're after, but could be used as a foundation for your needs.


                    I used this code as an automation example that was part of a larger tips and tricks session during the User Conference in 2007.


                    @echo off[/SIZE]

                    For %%i in (*.prn) Do Call :DoMonarch "%%i"[/SIZE]

                    GOTO :EOF[/SIZE]


                    ("C:\Program Files\Monarch\Program\Monarch.exe" /rpt:"%1" /mod:"Model.xmod" /exp:"C:\Folder\DataExport.xls" /T /exptable:"%1" /expfileopt:add)[/SIZE]

                    GOTO :EOF[/SIZE]



                    If you're up to a more robust programming based solution, or are just curious, you may be interested in [URL="http://********************/tips/monarch-programming-class"]an Excel tool for working with Monarch[/URL] that I've developed.


                    Edit: "No doubt my forum friends who code will suggest some simple VB code or similar to make that easier!" Somebody saw my reply coming while I was typing it...