Can I SET a filter on the same field multiple times?

I want to get the range 2 - 5 inclusive.

filter clear
filter add lt status 6
filter add gt status 1
filter set params

These commands output notes less than 6, including notes that have status of one and zero. The first filter command is winning.

Working with a different field set is also proving a challenge. Here is my command:

filter clear
filter add lt status 6
filter add gt priority 0
filter set params

The result includes Priorities which are zero. Priorities is type of Rank, and I’ve noticed that Notenik forces two numerals where I have only one.

my template
Priority: <rank: 0 - Low; 1 - Normal; 2 - ASAP; 3 - Immediate; 4 - Urgent; >

The dropdown selectors
00 - Low; 01 - Normal; 02 - ASAP; 03 - Immediate; 04 - Urgent;

The data stored in notes reflects the dropdown selectors. So Low is 00 - Low.

How do I filter these? I’d been assuming they would respond as a number. If that’s not true, then what do we use to approximate a “greater than”?

Good questions. Give me some time to dig in and get you some answers.

1 Like

Let’s take these one at a time.

In terms of multiple filter rules for the same field, this seems to be working as intended.

See the attached as an example.

The script includes two filters:

  • status gt 2
  • status lt 8

The collection includes one note for each of the default status values.

In the result file, status values of 2 - 7 are included. Status values of 0, 1, 8 & 9 are excluded.

You may wonder why the note with status value of 2 is being included. That’s because the full status value is “2 - Approved” which is indeed greater than “2” (since the two values are simply compared alphanumerically).

So, to get the desired results, you might want to change the first filter to ge 3.

Filter Test.zip (11.8 KB)

I think your second example, with status and priority, has the same root cause. Try changing your priority filter to look for ge 01.

OK. That’s making more sense of what I’m seeing. I had been presuming that the numerals had a special status.

I’ve just tested and it does work in the way that you are describing it.

1 Like