> ## Documentation Index
> Fetch the complete documentation index at: https://tally.outhebox.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Query language reference

> Every column type, operator and directive the parser accepts, with examples parsed by tally-core.

```
status is active
status is not past due and mrr > 2k
plan is pro or team
mrr between 1k and 5k
renewal last 30 days
renewal is 2026-01
account contains acme
owner is empty
acme corp, status is active
not (plan is free or mrr < 100)
sort by mrr desc
group by plan
```

Column names resolve by id, label or alias. Enum values resolve by value or label. Numbers accept `2k`, `1.5m`, `$5,000` and `12%`. Dates accept `2026`, `2026-01`, `2026-01-15`, `today`, `yesterday`, `last 7 days`, `next 2 weeks` and `this quarter`. Errors carry character offsets.

## Example schema

The examples in the tables below are parsed against this schema when the page is generated.

```json theme={null}
[
  { "id": "account", "label": "Account", "type": "text" },
  { "id": "owner", "type": "person" },
  {
    "id": "plan",
    "type": "enum",
    "options": [{ "value": "free" }, { "value": "pro" }, { "value": "team" }]
  },
  { "id": "mrr", "label": "MRR", "type": "currency" },
  { "id": "growth", "type": "percent" },
  { "id": "renewal", "type": "date" },
  { "id": "active", "type": "bool" }
]
```

## Column types

Every column type declares the operators it accepts. A condition with an operator the type does not list is a parse error.

| Type | Kind | Operators | Groupable | Searchable | Aggregates | Facet |
| - | - | - | - | - | - | - |
| `text` | text | `eq` `neq` `contains` `notContains` `startsWith` `endsWith` `in` `notIn` `empty` `notEmpty` | no | yes | `count` `distinct` | none |
| `enum` | enum | `eq` `neq` `in` `notIn` `empty` `notEmpty` | yes | yes | `count` `distinct` | terms |
| `currency` | number | `eq` `neq` `lt` `lte` `gt` `gte` `between` `in` `notIn` `empty` `notEmpty` | no | no | `sum` `avg` `min` `max` `count` `distinct` | histogram |
| `int` | number | `eq` `neq` `lt` `lte` `gt` `gte` `between` `in` `notIn` `empty` `notEmpty` | no | no | `sum` `avg` `min` `max` `count` `distinct` | histogram |
| `number` | number | `eq` `neq` `lt` `lte` `gt` `gte` `between` `in` `notIn` `empty` `notEmpty` | no | no | `sum` `avg` `min` `max` `count` `distinct` | histogram |
| `percent` | number | `eq` `neq` `lt` `lte` `gt` `gte` `between` `in` `notIn` `empty` `notEmpty` | no | no | `sum` `avg` `min` `max` `count` `distinct` | histogram |
| `bar` | number | `eq` `neq` `lt` `lte` `gt` `gte` `between` `in` `notIn` `empty` `notEmpty` | no | no | `avg` `min` `max` `count` | histogram |
| `date` | date | `eq` `neq` `lt` `lte` `gt` `gte` `between` `within` `empty` `notEmpty` | yes | no | `min` `max` `count` `distinct` | histogram |
| `bool` | boolean | `eq` `neq` `empty` `notEmpty` | yes | no | `count` `distinct` | terms |
| `email` | text | `eq` `neq` `contains` `notContains` `startsWith` `endsWith` `in` `notIn` `empty` `notEmpty` | no | yes | `count` `distinct` | none |
| `url` | text | `eq` `neq` `contains` `notContains` `startsWith` `endsWith` `in` `notIn` `empty` `notEmpty` | no | yes | `count` `distinct` | none |
| `id` | text | `eq` `neq` `contains` `notContains` `startsWith` `endsWith` `in` `notIn` `empty` `notEmpty` | no | yes | `count` `distinct` | none |
| `person` | text | `eq` `neq` `contains` `notContains` `startsWith` `endsWith` `in` `notIn` `empty` `notEmpty` | yes | yes | `count` `distinct` | terms |
| `duration` | number | `eq` `neq` `lt` `lte` `gt` `gte` `between` `in` `notIn` `empty` `notEmpty` | no | no | `sum` `avg` `min` `max` `count` `distinct` | histogram |

## Operators

| Operator | Arity | Printed as |
| - | - | - |
| `eq` | one | `account is acme` |
| `neq` | one | `account is not acme` |
| `lt` | one | `mrr < 1000` |
| `lte` | one | `mrr <= 1000` |
| `gt` | one | `mrr > 1000` |
| `gte` | one | `mrr >= 1000` |
| `between` | two | `mrr between 1000 and 5000` |
| `contains` | one | `account contains acme` |
| `notContains` | one | `account does not contain acme` |
| `startsWith` | one | `account starts with acme` |
| `endsWith` | one | `account ends with acme` |
| `in` | many | `account in (acme, globex)` |
| `notIn` | many | `account not in (acme, globex)` |
| `empty` | none | `account is empty` |
| `notEmpty` | none | `account is not empty` |
| `within` | relative | `renewal in last 30 days` |

## Conditions

A condition is a column followed by an operator and a value. Column names resolve by id, label or alias.

| Input | Canonical form | Parsed to |
| - | - | - |
| `plan is pro` | `plan is pro` | `eq` |
| `plan = pro` | `plan is pro` | `eq` |
| `plan is not free` | `plan is not free` | `neq` |
| `plan != free` | `plan is not free` | `neq` |
| `active is yes` | `active is true` | `eq` |
| `mrr > 2k` | `mrr > 2000` | `gt` |
| `mrr greater than 2k` | `mrr > 2000` | `gt` |
| `mrr at least 1.5m` | `mrr >= 1500000` | `gte` |
| `mrr >= $5,000` | `mrr >= 5000` | `gte` |
| `mrr under 500` | `mrr < 500` | `lt` |
| `mrr at most 1k` | `mrr <= 1000` | `lte` |
| `growth > 12%` | `growth > 12` | `gt` |
| `renewal after 2026-01-15` | `renewal > 2026-01-15` | `gt` |
| `renewal before 2026` | `renewal < 2026-01-01` | `lt` |

## Text

| Input | Canonical form | Parsed to |
| - | - | - |
| `account contains acme` | `account contains acme` | `contains` |
| `account has acme` | `account contains acme` | `contains` |
| `account does not contain test` | `account does not contain test` | `notContains` |
| `account starts with ac` | `account starts with ac` | `startsWith` |
| `account ends with corp` | `account ends with corp` | `endsWith` |
| `account acme` | `account contains acme` | `contains` |

## Lists

`in` matches any of the listed values. Values separated by `or` after `is` collapse into one `in` condition.

| Input | Canonical form | Parsed to |
| - | - | - |
| `plan is pro or team` | `plan in (pro, team)` | `in` |
| `plan in (pro, team)` | `plan in (pro, team)` | `in` |
| `plan one of pro or team` | `plan in (pro, team)` | `in` |
| `plan not in (free)` | `plan not in (free)` | `notIn` |
| `plan is not pro or team` | `plan not in (pro, team)` | `notIn` |

## Ranges

`between` is inclusive and orders its bounds. On dates, a year or a month expands to its first and last day.

| Input | Canonical form | Parsed to |
| - | - | - |
| `mrr between 1k and 5k` | `mrr between 1000 and 5000` | `between` |
| `mrr between 5k and 1k` | `mrr between 1000 and 5000` | `between` |
| `mrr 1k..5k` | `mrr between 1000 and 5000` | `between` |
| `mrr 1k to 5k` | `mrr between 1000 and 5000` | `between` |
| `renewal is 2026-01` | `renewal between 2026-01-01 and 2026-01-31` | `between` |
| `renewal is 2026` | `renewal between 2026-01-01 and 2026-12-31` | `between` |
| `renewal 2026-01 to 2026-03` | `renewal between 2026-01-01 and 2026-03-31` | `between` |

## Empty values

| Input | Canonical form | Parsed to |
| - | - | - |
| `owner is empty` | `owner is empty` | `empty` |
| `owner is blank` | `owner is empty` | `empty` |
| `owner is missing` | `owner is empty` | `empty` |
| `owner is not empty` | `owner is not empty` | `notEmpty` |
| `owner is set` | `owner is not empty` | `notEmpty` |

## Relative dates

Relative ranges resolve against the executor's `today`. The amount must be a whole number of periods.

| Input | Canonical form | Parsed to |
| - | - | - |
| `renewal last 30 days` | `renewal in last 30 days` | `within` |
| `renewal past 3 mo` | `renewal in last 3 months` | `within` |
| `renewal next 2 weeks` | `renewal in next 2 weeks` | `within` |
| `renewal upcoming quarter` | `renewal in next 1 quarter` | `within` |
| `renewal this quarter` | `renewal in this quarter` | `within` |
| `renewal this year` | `renewal in this year` | `within` |
| `renewal today` | `renewal in today` | `within` |
| `renewal yesterday` | `renewal in yesterday` | `within` |
| `renewal tomorrow` | `renewal in tomorrow` | `within` |
| `renewal within last 7 days` | `renewal in last 7 days` | `within` |
| `renewal in next month` | `renewal in next 1 month` | `within` |
| `renewal not in last 90 days` | `not renewal in last 90 days` | `not`, `within` |

## Search and flags

Bare words outside a condition search every searchable column. `is:name` is a flag; the data source decides what each flag means.

| Input | Canonical form | Parsed to |
| - | - | - |
| `acme` | `acme` | `search` |
| `"acme corp"` | `"acme corp"` | `search` |
| `acme corp, plan is pro` | `"acme corp" and plan is pro` | `and`, `search`, `eq` |
| `is:overdue` | `is:overdue` | `flag` |
| `not is:overdue` | `not is:overdue` | `not`, `flag` |

## Logic

Conditions joined by `and`, `&&` or a comma must all match. `or` matches either side, `not` negates, and parentheses group.

| Input | Canonical form | Parsed to |
| - | - | - |
| `plan is pro and mrr > 1k` | `plan is pro and mrr > 1000` | `and`, `eq`, `gt` |
| `plan is pro, mrr > 1k` | `plan is pro and mrr > 1000` | `and`, `eq`, `gt` |
| `plan is pro && mrr > 1k` | `plan is pro and mrr > 1000` | `and`, `eq`, `gt` |
| `plan is free or mrr < 100` | `plan is free or mrr < 100` | `or`, `eq`, `lt` |
| `not (plan is free or mrr < 100)` | `not (plan is free or mrr < 100)` | `not`, `or`, `eq`, `lt` |

## Sort and group

`sort by` without a direction sorts numbers and dates descending and everything else ascending.

| Input | Canonical form | Parsed to |
| - | - | - |
| `sort by mrr` | `sort by mrr desc` | `sort` |
| `sort by account` | `sort by account asc` | `sort` |
| `sort by mrr asc` | `sort by mrr asc` | `sort` |
| `order by renewal oldest first` | `sort by renewal asc` | `sort` |
| `group by plan` | `group by plan` | `group` |
| `plan is pro, sort by mrr desc, group by owner` | `plan is pro, sort by mrr desc, group by owner` | `eq`, `sort`, `group` |

## Grouping granularity

Date columns group into buckets. The query text groups by the column; the view sets the granularity.

| Granularity | Bucket of `2026-05-14` | Default |
| - | - | - |
| `day` | `2026-05-14` | |
| `week` | `2026-05-11` | |
| `month` | `2026-05` | yes |
| `quarter` | `2026-Q2` | |
| `year` | `2026` | |

## Aggregates

`sum`, `avg`, `min`, `max`, `count`, `distinct`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.