6 Replies Latest reply: May 15, 2014 10:06 AM by Joe Berry RSS

    Apply Different Filters with .Bat

    jeremytech _

      We run a large number of scripts via BAT files and I ran into a scenario today where I wound up duplicating the same xmod 6 times and applying a slightly modified filter in the table view. (IE Looking for the rows in the column that say Accepted for one xmod and then the next xmod being Rejected. )


      I am able to build multiple filters into a single xmod since only one is applied at any given time so I was hoping to be able to pass in a specific filter in my bat file. Anyone know of a way to do this?

        • Apply Different Filters with .Bat
          Data Kruncher

          Hello and welcome jeremytech.


          As I see it, you've got two possible options.


          The first is the easiest, but will necessitate modifying the model ever so slightly.


          You'll need to first create a runtime parameter calculated field, and then modify your filter so as to link the filter field to the runtime parameter, such as:



          Now you can add a /set:RuntimeStatus="Rejected" to your command line in your batch file, and then duplicate the line in the batch file, changing Rejected to Accepted.


          Of course, this means that you'll be launching multiple Monarch sessions to handle each filter value.


          To alleviate that, if necessary, depending on your time requirements for running the extract and the size of your datasource, the next option would require a fair bit more effort up front, but would be more efficient in the end.


          This would involve [URL="http://********************/tips/monarch-programming-class"]writing some program code[/URL] in [URL="http://********************/xlreport/learn-to-program-excel-to-become-a-better-monarch-modeler"]Excel VBA[/URL] for instance to open the datasource, apply the model, and then set a filter and export, set a different filter and export, set a different filter and export, etc.


          It would work very nicely, as you would only run Monarch and open the datasource once, but there might be a learning curve for you depending upon your experience.