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

Things you’d like to miss in the future...
Forum rules
:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:

:info: Please include the following information:
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".

:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:
Post Reply
schindi
Posts: 23
Joined: 12 Aug 2021 10:36
Location: Windows 11 Pro 24H2 with Screen Scaling 100%

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
Directory content:
directory_content.png
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
v2:
Filter_result_v2.png
Am I doing something wrong in the syntax or is there a bug?
To see the attached files, you need to log into the forum.

LittleBiG
Posts: 1848
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: 66619
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @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: 1848
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: 23
Joined: 12 Aug 2021 10:36
Location: Windows 11 Pro 24H2 with Screen Scaling 100%

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