Skip to main content

Filtering reporting data in Excel

Fields, operators and how values and dates are read when you filter reporting data in Excel.

How to filter HealthRota reporting data from the Excel add-in — fields, operators, and how values (numbers, text, dates, ranges, multiple ids) are interpreted. The same rules apply wherever you set a filter: the task pane, the =HEALTHROTA.GET function, and the =HEALTHROTA.QUERY function.

The filter model

Every filter is three things:

Part

What it is

Examples

field

the column to filter on

date, updated_at, rota_id, status, ids

operator

how to compare

eq, gte, in, range, contains, …

value

what to compare against

42, "ward", 2026-01-01, 1,2,3

Multiple filters are combined with AND — a row only matches if it satisfies all of them.

Operators

Operator

Meaning

Use with

Value

eq

equals

numbers, text, dates

single

neq

not equals

numbers, text, dates

single

lt

less than

numbers, dates

single

lte

less than or equal

numbers, dates

single

gt

greater than

numbers, dates

single

gte

greater than or equal

numbers, dates

single

in

is one of

ids / numbers / text

list (comma-separated)

range

between (inclusive)

numbers, dates

exactly two values (min, max)

contains

text contains

text

single

starts_with

text begins with

text

single

ends_with

text ends with

text

single

Values and how they're read

  • Numbers — a value that looks numeric is sent as a number (42, 3.5). Use these for ids and numeric fields.

  • Text — anything non-numeric is sent as text (approved, ward). Don't add quotes in the task pane or QUERY cells; the text is taken as-is.

  • Multiple values (in) — comma-separate them: 1,2,3. Whitespace is trimmed. Each value is read as a number or text as above. This is the normal way to filter by several ids.

  • Ranges (range) — give two comma-separated values, min,max, and the result is inclusive of both ends. More or fewer than two values is rejected.

The server coerces each value to the field's real type, so a numeric id field gets a number, a date field gets a date, etc. If a value can't be coerced (e.g. text where a number is expected) you get a clear error (see Validation and errors, below).

Dates

The API stores dates as YYYY-MM-DD. You don't have to type that exact format — the add-in converts date values automatically before sending. Accepted inputs for any date field:

You enter

Sent to the API

2026-01-31 (ISO)

2026-01-31

31/01/2026 or 31-01-2026 (UK day/month/year)

2026-01-31

a date-formatted Excel cell (e.g. =HEALTHROTA.QUERY referencing A1)

2026-01-31

2026-01-31T09:00:00Z (full timestamp, for updated_at)

passed through unchanged

A field is treated as a date when it is date, from, or ends in _date or _at (start_date, end_date, updated_at, …).

Single-date vs period entities

  • Single-date resources (e.g. work_items, time_sheet_items, exception_reports, locum_offer_shifts) expose a date field. Filter it directly:

    • on/after a day: date gte 2026-01-01

    • a window: date range 2026-01-01,2026-03-31

  • Period resources (e.g. sub_types, job_plans, job_plan_activities, shift_requirements, rota_members, rota_status_periods) expose start_date and end_date as separate fields, so you choose the comparison yourself:

    • starts in 2026: start_date gte 2026-01-01

    • active during March 2026 (overlap): start_date lte 2026-03-31 and end_date gte 2026-03-01

updated_at is a timestamp on every resource — use it with gte/lte/range and a date (start of that day, UTC) or a full ISO timestamp.

Which fields can I filter?

Each resource accepts its own set of fields. In the task pane the filter "field" box suggests the valid fields for the chosen data type (driven live by the API), so the easiest path is to pick from the list.

Common fields:

  • ids — the record's primary key. ids in 101,102,103, or ids eq 101.

  • updated_at — last-changed timestamp (good for "what changed since…").

  • date / start_date / end_date — see Dates, above.

  • relation ids — slice by a related entity: rota_id, user_id, department_id, team_id, location_id, specialty_id, organisation_unit_id, shift_requirement_id, work_item_id, … Use in for several: rota_id in 1,2,3.

  • status — on time_sheet_items and locum_offer_shifts.

(The authoritative per-type list comes from the API's meta endpoint; the pane reflects it automatically.)

Setting filters — the three ways

1. Task pane (Build a query)

Add a filter row and fill in the three boxes:

field: date       op: range   value: 2026-01-01,2026-03-31
field: rota_id op: in value: 1,2,3

Add as many rows as you like (combined with AND), choose your columns, then Insert live query. The pane writes the filters into Field / Operator / Value cells and a =HEALTHROTA.QUERY formula that reads them (way 3 below).

2. =HEALTHROTA.GET — filters as a text string

Filters are one string: clauses separated by ;, each written as field op value.

=HEALTHROTA.GET("work_items", "rota_id in 1,2,3; date gte 2026-01-01", "id,date,start,end")
=HEALTHROTA.GET("work_items", "date range 2026-01-01,2026-03-31")
=HEALTHROTA.GET("time_sheet_items", "status eq approved; user_id in 10,11")

Signature: =HEALTHROTA.GET(type, [filters], [columns], [includeHeaders]). Omit filters for everything, omit columns for all columns. type accepts either the resource name (work_items) or the display name shown in the task-pane picker (WorkItems).

3. =HEALTHROTA.QUERY — filters from cells

Point at a range of field | operator | value rows, so the filters live in cells (with your own dropdowns/validation) and the data re-pulls when they change.

       A           B        C
1 rota_id in 1,2,3
2 date gte 2026-01-01

=HEALTHROTA.QUERY("work_items", A1:C2, E1:E3) // E1:E3 = column names to return

Notes for QUERY:

  • For in/range, put the comma-separated values in the single value cell (1,2,3).

  • A date-formatted cell works for single-value date operators (eq/gte/lte) — it's converted automatically. For a date range, type the two dates as text in one cell (2026-01-01,2026-03-31).

  • Blank rows are ignored.

Validation & errors

Filters are checked before sending, so mistakes come back immediately:

  • Unknown field — e.g. deparment_id → "Unknown field "deparment_id". Available: department_id, rota_id, …" (the pane lists the valid fields for that type).

  • Unknown operator — anything not in the operator table.

  • Missing value — an operator with no value.

  • Bad range — range without exactly two values.

  • Empty in — in with no values.

In the task pane these appear in red under the query. In a function they appear as the cell's error message (e.g. hover the #VALUE!). If a bad value still reaches the server (for example text in a numeric field), the API replies with a specific message such as "Invalid filter value 'abc' (expected a date (yyyy-MM-dd))", which the add-in shows verbatim.

Cheat sheet

ids        in     101,102,103          # several records by id
ids eq 101 # one record
rota_id in 1,2,3 # by related entity
date gte 2026-01-01 # on/after a day
date range 2026-01-01,2026-03-31# inclusive window
start_date gte 2026-01-01 # period: starts on/after
end_date lte 2026-12-31 # period: ends on/before
updated_at gte 2026-06-01 # changed since (start of day UTC)
status eq approved # text equals
name contains ward # text contains

Did this answer your question?