6 Replies Latest reply: May 15, 2014 10:05 AM by adonis _

# Sample Formula-Based Formulas

Does anyone have any sample formulas as I am new to Monarch and the syntax is a bit different from sql etc.

Example:  Can you please provide an example to create the following:

#1)

branch_cd not in  200-299 and 400-499 ranges.

and CLH not in  22601, 22611

and Blotter not in 1U

#2)

CLH 13, 2039, 2108, 2116, 2450, 2669

and  branch_cd in 000-899, 954 & 992

and  blotter not in 1U

• ###### Sample Formula-Based Formulas

Here's the formula-based filters that seem to work for me and I hope it's what you're looking for. There may be an easier way to do it, but this is the best way I could come up with.

Example #1:[/B]

(Branch_CD < 200 .Or. (Branch_CD > 299 .And. Branch_CD < 400) .Or. Branch_CD > 499)  .And. CLH .NotIn.(22601, 22611) .And. Blotter .NotIn.("1U")

/CODE

Example #2:[/B]

CLH .In.(13, 2039, 2108, 2116, 2450, 2669) .And. ((Branch_CD >= 0 .And. Branch_CD <= 899) .Or. (Branch_CD >= 954 .And. Branch_CD <= 992)) .And. Blotter .NotIn.("1U")

/CODE

Hope this helps,

Micheal

• ###### Sample Formula-Based Formulas

Hi adonis and welcome to the forum.

At a glance Michael's solution looks very appropriate.

Personally I would let Monarch do the compositing of the component filters by defining (and testing) each filter individually and then use the Compound Filter feature to put them all together.

Apart from making each filter component easier to create and test there is also the benefit that you end up with a library of pre-defined, simpler filters that can be combined in other ways very quickly should that be needed at a later stage. Adapting a filter to a different purpose (and testing it) also becomes somewhat quicker.

HTH.

Grant

• ###### Sample Formula-Based Formulas

Thanks Grant & Mike

I have done compound filters and such before and they work too.  However when exporting into excel, it shows all filters.  How do you exclude specific filters from printing?

My question to you would be, how can i print multiple filters and or say don't print specific filters in Monarch Pro 10?

I heard you can use the project files to do something like this but from what i saw you it allows you to print one or all in the filters in the export function.

What if there are 3 filters and i want to print only 1 specific filter?

That way when i use a batch file I can get specific filters to print out in a batch file.

I saw something when using the /prj and putting /exall but when i tried it didn't work well.

Can you help me out with fixing the following batch file so that I can create perhaps a process which prints all the filters into seperate tabs?

when i use the batch file, it only prints the specific filter i saved the model in.

how can i get the batch file to print all filters or specific filters if there were more then 1 (in 1 spreadsheet with multiple tabs)?

ECHO "Generating NSCC Contract..."

SET MTH=%DATE:~4,2%

SET DAY=%DATE:~7,2%

SET YR=%DATE:~10,4%

SET MYDATE=%YR%%MTH%%DAY%

ECHO "Generating FSTP67 Report Creation Process..."

"C:\Program Files\Monarch\Program\monarch.exe" /rpt:"
Pegasus\operations\Operations\R&D Department\Fail Control\Confirm Report\Text File Folder\FSTP67.txt" /mod:"
Pegasus\operations\Operations\R&D Department\Fail Control\Confirm Report\Models\FSTP67.xmod"  /exp:"
Pegasus\operations\Operations\R&D Department\Fail Control\Confirm Report\CONFIRM_REPORT_%MYDATE%.xls" /T

• ###### Sample Formula-Based Formulas

anyone have any ideas how to use a project file in batch file as provided, need help to determine which filters can be chosen vs. ALL or one.

• ###### Sample Formula-Based Formulas

Before getting into filter discussion, your "/exall" above should be "/pxall". That may get better results for you.

As to the setting and controlling of filters for exports, you cannot do that via the command line, unless you have separate models for each filter, setting the appropriate filter as the current filter before saving each model with a unique name. But that may not be practical, and is likely a "looking for trouble" solution.

The better, more robust approach is to move up to the next level of Monarch's automation control by taking advantage of the COM programming tools. This will allow you to take full "remote" control of Monarch, short of creating models dynamically.

The full documentaion is available on the Datawatch support site as the downloadable Programmers Manual for v8. The COM automation hasn't changed in subsequent versions (with the exception of at least one documented bug introduced by the v10.01 patch).

HTH,

Kruncher

PS I should also mention [URL="http://********************/tips/monarch-programming-class"]another possibility[/URL] for assisting with Monarch's COM programming.

• ###### Sample Formula-Based Formulas

I might have mistyped it but i think it didn't work for me when i placed the correct parameters, but i find it a lot easier putting multiple models saving the filter working on and creating a .bat process which is a lot faster then running a vbs process.  it may take 20-30 secs max if using a .bat vs. the vbs which takes minutes plus frustrating waiting for it to finish.

The users I work with, need simplicity, though your solution may probably best but I am not indepth of a programmer, just know tricks and means by which to get the output out.  I thought there would be a process to allow me to put what filters I wanted, not just picking all or a specific one.

anyways thanks again for the fast response, I wish you a great day.

I guess for now, I am good, but will ask you if I have any questions, as I see you are the master at this tool.