2 Replies Latest reply: May 15, 2014 10:14 AM by Grant Perkins RSS

    Filtering by file name

    feldwickm _



      I'm having problems in Monarch 10.5 setting up a filter to remove duplicate entries in 2 different files. I know that in the file with file name containing &, there are records found in the other files that I'm opening, but that it contains records (identifiable by the entity field beginning with 3) which I need. I have therefore set up the following filter:


      If(RSplit(File(),2,"\",1) .In.("&"), Str(entity).In.("3"),Str(entity).In.("1"))


      However, it only returns the records where entity begins with 3, it ignores the other open files entirely.


      I've also tried having the file name as a calculated field, but can't filter correctly on that either.


      Is this a limitation in Monarch, or am I missing something obvious?



      Please help!


      Kind Regards



        • Filtering by file name
          Olly Bond

          Hello Martin,


          I don't think an if statement is the right format for a filter expression. If you build filters using .and. and .or. and .not., you should get more sensible results.


          Best wishes,



            • Filtering by file name
              Grant Perkins



              Funny things filters, especially the more complex ones.


              I would approach this by creating separate simple filters that are easy to test, one for each filter requirement.


              Then throw those into a  Compound filter or a series of compounded compound filters if necessary and test the results against expectation at each stage.


              The additional benefit of such an approach is that if anything should change at some point in the future maintainance of just the part that has changed is likely to be easier to apply.