openmolecules.org

 
Home » DataWarrior » Functionality » Category Filter logic
Category Filter logic [message #1123] Wed, 18 November 2020 21:01 Go to next message
chemtv is currently offline  chemtv
Messages: 10
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 Go to previous messageGo to next message
nbehrnd is currently offline  nbehrnd
Messages: 61
Registered: June 2019
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.

index.php?t=getfile&id=290&private=0

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 Go to previous message
thomas is currently offline  thomas
Messages: 384
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
Previous Topic: Updating Merged Columns
Next Topic: pchembl values
Goto Forum:
  


Current Time: Thu Dec 03 21:20:33 CET 2020

Total time taken to generate the page: 0.01208 seconds