Filter Syntax: Result for Boolean AND depending on the sequence of the criterias?

Things you’d like to miss in the future...
Post Reply
schindi
Posts: 13
Joined: 12 Aug 2021 10:36

Filter Syntax: Result for Boolean AND depending on the sequence of the criterias?

Post by schindi »

I combined 2 of the available examples for the power filtering with a Boolean AND:
version 1: ageM: d AND !attr: d
version 2: !attr: d AND ageM: d
Filter_Settings.png
Filter_Settings.png (52.3 KiB) Viewed 594 times
Directory content:
directory_content.png
directory_content.png (101.14 KiB) Viewed 594 times
Expected filtering result: Files modified today --> in this example: XYplorerHelp_23.60.pdf
But the filtering results are dependent on the sequence of defined criterias and both still contain a directory.
v1:
Filter_result_v1.png
Filter_result_v1.png (11.54 KiB) Viewed 594 times
v2:
Filter_result_v2.png
Filter_result_v2.png (96.95 KiB) Viewed 594 times
Am I doing something wrong in the syntax or is there a bug?

LittleBiG
Posts: 1846
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: Filter Syntax: Result for Boolean AND depending on the sequence of the criterias?

Post by LittleBiG »

The first one doesn't contain folder here, so I cannot confirm.

The starting "!" or "NOT" will revert the whole filter. Use this to achieve what you want (in v2): attr: NOT d AND ageM: d
Last edited by LittleBiG on 26 Sep 2022 12:05, edited 1 time in total.

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Filter Syntax: Result for Boolean AND depending on the sequence of the criterias?

Post by admin »

This might shed some light on it:

Code: Select all

v22.20.0222 - 2021-09-24 15:10
    + Visual Filters and Live Filters: Now, by factory default, you can invert a 
      whole Boolean expression ("master-invert") by wrapping it into parentheses 
      and prefixing a !:
        Example:            Size: 529 KB | Name:*.txt       = Size OR Name
        Master-Inversion:   !(Size: 529 KB | Name:*.txt)    = NOT (Size OR Name)
      That way you can use a mere ! to just invert the first part of the expression:
        Example:           !Size: 529 KB | Name:*.txt       = (NOT Size) OR Name
    > UPGRADERS: To prevent breaking old code a tweak is auto-set for upgraders 
      that keeps it as it was before:
        VFAllowMasterInvertOldWay=1
      The old way:
        !Size: 529 KB | Name:*.txt       = NOT (Size OR Name)
        !(Size: 529 KB | Name:*.txt)     = NOT ("(Size" OR "Name)") (= total rubbish)
      It is recommend that you update your scripts and set 
      VFAllowMasterInvertOldWay=0 to enjoy the benefits of the new syntax.

LittleBiG
Posts: 1846
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: Filter Syntax: Result for Boolean AND depending on the sequence of the criterias?

Post by LittleBiG »

admin wrote: 26 Sep 2022 12:03 This might shed some light on it:
Or that. :)
I still had the VFAllowMasterInvertOldWay set to 1.

schindi
Posts: 13
Joined: 12 Aug 2021 10:36

Re: Filter Syntax: Result for Boolean AND depending on the sequence of the criterias?

Post by schindi »

Thanks for your explanations to clarify my topic. :)

Many amazing possibilities but also details you struggle with, even if you just try to combine two examples with AND.

Post Reply