Build filter from tribble
Arguments
- filters
tribble with columns
column
operator
value
Possible values for operator:
(not_)contains
(not_)icontains
start_with
ends_with
(not_)matches
eq
neq
(not_)empty
- global_operator
"and" or "or"
Value
filter json encoded to feed to build_query
Examples
filters <- tibble::tribble(
~column, ~operator, ~value,
"event_url", "matches", "Zamperoni",
"event_url", "matches", "-1[34]"
)
# With optional transformation
filters <- tibble::tribble(
~column, ~operator, ~value, ~transformation,
"event_url", "starts_with", "/medien", "to_path",
"event_url", "matches", "-1[34]", NULL
)
filters <- build_filter(filters, "and")
# If values of two or more different types are used use lists
filters <- tibble::tribble(
~column, ~operator, ~value,
"device_type", "eq", list(0),
"location_country_name", "eq", list("DE")
)
# This also works for transformation