plugin:struct:filters
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:struct:filters [2020-04-11 21:02] – RamonMR | plugin:struct:filters [2023-11-01 16:06] (current) – [Fixed Filters] andi | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | putos | + | <= [[plugin: |
+ | |||
+ | ====== Struct Plugin: Filters ====== | ||
+ | |||
+ | Filters are used to filter [[plugin: | ||
+ | |||
+ | ===== Fixed Filters ===== | ||
+ | |||
+ | Fixed filters are added through the '' | ||
+ | |||
+ | Example: | ||
+ | |||
+ | < | ||
+ | ---- struct table ---- | ||
+ | schema | ||
+ | cols : %pageid%, product, budget, team | ||
+ | filter | ||
+ | filteror : product = Fantastico Professional | ||
+ | ---- | ||
+ | </ | ||
+ | |||
+ | Column names can of course reference the full column name (eg. '' | ||
+ | |||
+ | ===== Comparators ===== | ||
+ | |||
+ | For filtering, multiple comparators are possible: | ||
+ | |||
+ | ^ Comparator | ||
+ | | '' | ||
+ | | '' | ||
+ | | ''<'' | ||
+ | | '' | ||
+ | | ''>'' | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | |||
+ | ===== Value Placeholders ===== | ||
+ | |||
+ | When defining fixed filters it is sometimes useful to compare against semi-dynamic values. This is where value placeholders come in handy. You simply use the placeholder instead of a value when creating the filter. | ||
+ | |||
+ | The following example prints all projects the current user is a team member of: | ||
+ | |||
+ | < | ||
+ | ---- struct table ---- | ||
+ | schema | ||
+ | cols : %pageid%, product, budget, team | ||
+ | filter | ||
+ | ---- | ||
+ | </ | ||
+ | |||
+ | ^ Placeholder | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | |||
+ | ===== Dynamic Filters ===== | ||
+ | |||
+ | Aggregations can be " | ||
+ | |||
+ | The following example adds filter input fields for all selected columns. | ||
+ | |||
+ | < | ||
+ | ---- struct table ---- | ||
+ | schema | ||
+ | cols : %pageid%, product, budget, team | ||
+ | dynfilters : 1 | ||
+ | ---- | ||
+ | </ | ||
+ | |||
+ | Filters created through this method always use the '' | ||
+ | |||
+ | ==== Manually Creating Filter Links ==== | ||
+ | |||
+ | Dynamic filters can also be added through the '' | ||
+ | |||
+ | Example: ''? | ||
+ | |||
+ | For example you could add the above filter to an internal link like this: | ||
+ | |||
+ | < | ||
+ | [[: | ||
+ | </ | ||
+ | |||
+ | When following that link, an aggregation on that page '' | ||
+ | ===== Multiple Filters ===== | ||
+ | |||
+ | If multiple '' | ||
+ | |||
+ | The following example removes all results with the color yellow or green from the result set. | ||
+ | |||
+ | < | ||
+ | ---- struct table ---- | ||
+ | schema: colors | ||
+ | cols: * | ||
+ | filter: color <> yellow | ||
+ | filter: color <> green | ||
+ | csv: 0 | ||
+ | ---- | ||
+ | </ | ||
+ | |||
+ | 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 '' | ||
+ | |||
+ | The following two examples are identical and will only show results where the color is either yellow or green. | ||
+ | |||
+ | < | ||
+ | ---- struct table ---- | ||
+ | schema: colors | ||
+ | cols: * | ||
+ | filteror: color = yellow | ||
+ | filteror: color = green | ||
+ | csv: 0 | ||
+ | ---- | ||
+ | |||
+ | ---- struct table ---- | ||
+ | schema: colors | ||
+ | cols: * | ||
+ | filter: color IN (" | ||
+ | csv: 0 | ||
+ | ---- | ||
+ | |||
+ | </ | ||
+ | |||
+ | Note that the struct plugin currently has no support for the '' | ||
plugin/struct/filters.1586631735.txt.gz · Last modified: 2020-04-11 21:02 by RamonMR