Category Filter logic [message #1123] |
Wed, 18 November 2020 21:01  |
chemtv
Messages: 18 Registered: February 2015 Location: Indianapolis
|
Junior Member |
|
|
From the behavior of using several category filters together it seems the combination of filters uses AND logic? Can this be switched to OR logic?
ie. I get the union of the exact match of filters rather than all the rows with at least one filter being met.
Thanks for the hard work keeping datawarrior running so well!
Greg
|
|
|
Re: Category Filter logic [message #1124 is a reply to message #1123] |
Wed, 18 November 2020 21:55   |
nbehrnd
Messages: 121 Registered: June 2019
|
Senior Member |
|
|
Hello Greg,
once the properties are stored in DW's main table, both Boolean .or. and .and. may be used for further analysis. In the example below, I extended the initial query for molecular weights greater than 110 (yielding mesitylene) to one that would accept molecules with a molecular weight of either less than 80 .or. greater than 110 by the instruction
if((TotalMolweight<80) || (TotalMolweight>110), "True", "False")
in an additional column (Data -> Add Calculated Values). As expected, the second query yields both benzene and mesitylene now.

It is possible to use multiple properties of different columns, too. DW's mathematics, including logic expressions, which may be used are presented on
http://www.openmolecules.org/help/jep.html
Norwid
[Updated on: Wed, 18 November 2020 21:58] Report message to a moderator
|
|
|
Re: Category Filter logic [message #1130 is a reply to message #1124] |
Fri, 20 November 2020 22:51  |
thomas
Messages: 502 Registered: June 2014
|
Senior Member |
|
|
Multiple filters are always AND, which means that a row to be shown must meat all filter's criteria.
Nevertheless, logical OR filtering often can be achieved by one of these ways:
- Use a single filters for logical OR, e.g.
- a text filter with multiple comma separated items
- an 'ALL COLUMNS' text filter that searches all columns at once
- category filters use a natural OR
- use a multi structure filter hitting if at least one of the provided query structures match
- Using multiple filters with 'inverse' settings allows to model OR to some extend
|
|
|