DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:struct:filters

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Both sides next revision
plugin:struct:filters [2020-04-11 21:37]
cgalo old revision restored (2020-03-31 20:27)
plugin:struct:filters [2021-07-21 10:47]
vic666 [Dynamic Filters]
Line 83: Line 83:
  
 Example: ''?flt[projects.budget>]=10000'' Example: ''?flt[projects.budget>]=10000''
 +
 +===== Multiple Filters =====
 +
 +If multiple ''filter:'' instructions are used, all conditions must be true, comparable to the AND operator in SQL. 
 +
 +The following example removes all results with the color yellow or green from the result set. 
 +
 +<code>
 +---- struct table ----
 +schema: colors
 +cols: *
 +filter: color <> yellow
 +filter: color <> green
 +csv: 0
 +---- 
 +</code>
 +
 +To combine multiple filters where it is sufficient for any of the conditions to be true, comparable to the OR operator in SQL, you can either work with ''filteror:'' instructions or with the ''IN'' comparator, also present in SQL. 
 +
 +The following two examples are identical and will only show results where the color is either yellow or green. 
 +
 +<code>
 +---- struct table ----
 +schema: colors
 +cols: *
 +filteror: color = yellow
 +filteror: color = green
 +csv: 0
 +---- 
 +
 +---- struct table ----
 +schema: colors
 +cols: *
 +filter: color IN ("yellow","green")
 +csv: 0
 +---- 
 +
 +</code>
 +
 +Note that the struct plugin currently has no support for the ''NOT'' operator present in SQL. For example, it's currently not possible to create a filter with a ''NOT IN'' comparator. 
 +
  
plugin/struct/filters.txt ยท Last modified: 2021-07-21 10:47 by vic666