Custom Reporting QL
Custom Reporting lets coordinators and admins build lightweight, read-only reports using a small WildTrack360 query language. It is available from Tools -> Custom Reporting.
The QL is not SQL. Each query line is parsed into a safe internal structure, data is fetched through normal organisation-scoped application queries, and results are aggregated in application code.
Who Can Use It
| Action | Access |
|---|---|
| Open Custom Reporting | Users with report:view_species |
| Preview report queries | Admin, Coordinator All, Coordinator |
| Save report queries | Admin, Coordinator All, Coordinator |
| Edit/delete/toggle a saved query | Query creator, or Coordinator/Admin-level user |
Carers are intentionally excluded from Custom Reporting because the reports are organisation-level aggregates, not individual carer worklists.
How the Workbench Works
- Go to Tools -> Custom Reporting.
- Choose a template or write one query per line.
- Set the From and To date controls if needed.
- Click Preview.
- Review the table and chart output.
- Save useful queries to the organisation library.
- Toggle Show on dashboard to pin a saved query as a dashboard widget.
Previewing a query does not use Wally or AI tokens. Wally can help draft a query, but the workbench itself uses the parser and evaluator directly.
Query Syntax
Write clauses in this order:
count from <source>
[between YYYY-MM-DD and YYYY-MM-DD]
[where <field> = <value>]
[group by <field>]
[trend by <field>]
[limit N]
[chart number|table|bar|pie|line]
For numeric totals, use:
sum <numericField> from <source>
[between YYYY-MM-DD and YYYY-MM-DD]
[where <field> = <value>]
[group by <field>]
[trend by <field>]
[limit N]
[chart number|table|bar|pie|line]
You can also use as instead of chart:
count from incidents as table
Clause Reference
| Clause | Purpose | Example |
|---|---|---|
count | Count matching rows | count from incidents |
sum <numericField> | Add numeric values | sum trainingHours from carer_training |
from <source> | Select an allowlisted reporting source | from animals |
between ... and ... | Apply an inclusive date range | between 2026-01-01 and 2026-06-01 |
where <field> = <value> | Filter by exact equality | where resolved = false |
group by <field> | Break totals into categories | group by severity |
trend by <field> | Produce a time series | trend by recordedMonth |
limit N | Keep the top N groups or latest N trend buckets | limit 10 |
chart ... | Choose output style | chart bar |
Use quotes for values containing spaces:
count from animals where species = "Eastern Grey Kangaroo"
Boolean filters accept true, false, yes, no, 1, and 0.
Date Ranges
Every query is bounded by a date range:
| Date source | When it applies |
|---|---|
Inline between clause | Takes priority over page date controls |
| Page From and To controls | Used when the query does not include between |
| Default trailing one-year window | Used when no inline or page range is supplied |
The maximum range is 366 days. The date range is applied to the source's configured date field.
Time buckets such as foundDay, foundMonth, recordedDay, and recordedMonth are calculated in the Australia/Sydney time zone.
Sources and Fields
Only these sources and fields are available. Source names and field names must be written exactly as listed.
Animals
Use animals for animals admitted in a date range, grouped by current state such as species, status, or current carer.
| Detail | Value |
|---|---|
| Date range field | dateFound |
| Fields | species, status, sex, ageClass, outcome, released, deceased, hasPhoto, hasNotes, hasCarer, carerName, weightGrams, foundDay, foundMonth, releasedDay, releasedMonth |
| Sum fields | weightGrams |
animals is a current-state snapshot. A trend over foundMonth shows intake by month, not historical changes to an animal's status.
Animal Assignments
Use animal_assignments for internal carer assignment events.
| Detail | Value |
|---|---|
| Date range field | transferDate |
| Fields | carerName, hasPreviousCarer, assignmentDay, assignmentMonth |
| Sum fields | None |
Use this source when the question is about which carer received animals during a period.
Incidents
Use incidents for incident reports by type, severity, resolution, animal linkage, and attachments.
| Detail | Value |
|---|---|
| Date range field | date |
| Fields | type, severity, resolved, hasNotes, hasAnimal, hasAttachments, recordedDay, recordedMonth |
| Sum fields | None |
Hygiene Logs
Use hygiene_logs for biosecurity and hygiene checks.
| Detail | Value |
|---|---|
| Date range field | date |
| Fields | type, completed, enclosureCleaned, ppeUsed, handwashAvailable, feedingBowlsDisinfected, hasPhotos, loggedDay, loggedMonth |
| Sum fields | None |
Carer Training
Use carer_training for training records, certificate coverage, expiry status, and training hours.
| Detail | Value |
|---|---|
| Date range field | date |
| Fields | trainingType, provider, hasCertificate, expired, trainingHours, completedDay, completedMonth |
| Sum fields | trainingHours |
Care Records
Use records for animal care log entries such as feeding, medical, weight, or observations.
| Detail | Value |
|---|---|
| Date range field | date |
| Fields | type, hasNotes, hasLocation, recordedDay, recordedMonth |
| Sum fields | None |
Release Checklists
Use release_checklists for release readiness and release-type reporting.
| Detail | Value |
|---|---|
| Date range field | releaseDate |
| Fields | releaseType, completed, within10km, releasedDay, releasedMonth |
| Sum fields | None |
Post-Release Monitoring
Use post_release_monitoring for post-release sighting and condition observations.
| Detail | Value |
|---|---|
| Date range field | date |
| Fields | animalCondition, hasPhotos, hasNotes, observedDay, observedMonth |
| Sum fields | None |
Assets
Use assets for current equipment and inventory status.
| Detail | Value |
|---|---|
| Date range field | createdAt |
| Fields | type, status, hasAssignee, createdDay, createdMonth |
| Sum fields | None |
assets is a current-state snapshot. Trends show creation dates, not historical status changes.
Examples
Unresolved Incidents by Type
count from incidents where resolved = false group by type chart table
Incidents by Severity
count from incidents group by severity chart bar
Animals by Current Status
count from animals group by status chart pie
Top Species in Care
count from animals group by species limit 10 chart bar
Animal Intake Trend by Species
count from animals group by species trend by foundMonth chart line
Carer Assignment Events
count from animal_assignments between 2026-01-01 and 2026-06-01 group by carerName limit 10 chart table
Training Hours by Type
sum trainingHours from carer_training group by trainingType chart bar
Training Hours Over Time
sum trainingHours from carer_training group by trainingType trend by completedMonth chart line
Hygiene Completion
count from hygiene_logs group by completed chart pie
Care Activity Trend
count from records group by type trend by recordedMonth chart line
Chart Selection
If you do not specify a chart, WildTrack360 chooses one:
| Query shape | Default |
|---|---|
| Plain count or sum | number |
group by only | bar |
trend by | line |
Available chart types are:
numbertablebarpieline
The workbench may warn when a chart does not fit the query. For example, a line chart without a trend by field or a crowded pie chart may be hard to read.
Saved Queries and Dashboard Widgets
Saved queries are shared with the organisation. Each saved query stores:
- Name
- Query text
- Visualisation type
- Whether it should appear on the dashboard
- Creator
When Show on dashboard is enabled, the saved query appears as a Custom Report widget on the home dashboard. Dashboard widgets use the same parser and evaluator as the workbench.
Safety Rules
Custom Reporting is deliberately limited:
- Queries are read-only.
- Query text is never executed as SQL.
- Sources and fields must be allowlisted.
- All reads are scoped to the current Clerk organisation.
- Results return aggregates only, not raw records.
- Raw organisation IDs, user IDs, Clerk IDs, emails, addresses, coordinates, attachments, JSON payloads, notes, and descriptions are not exposed.
- Free-text fields are reduced to boolean flags such as
hasNotesorhasPhotos. - Only equality filters are supported.
- Joins, subqueries,
AND,OR, non-equality operators, ordering, raw field paths, and mutation verbs are rejected. - Date ranges are capped at 366 days.
limitis capped at 50.
When to Ask Wally
Use Wally when you know the reporting question but not the QL syntax.
Example:
Wally, can you make a Custom Reporting query for training hours by month?
Wally can suggest:
sum trainingHours from carer_training trend by completedMonth chart line
If the requested report needs unavailable fields or unsupported logic, Wally should explain the limitation and suggest the closest valid query.
Related Documentation
| Page | Why it matters |
|---|---|
| Wally AI Assistant | How Wally helps draft and explain reporting queries |
| Data Export & Reporting | Full exports and NSW register exports |
| Compliance Management | NSW annual reporting and regulatory reporting workflows |
| Roles & Permissions | Reporting access and role-scoped permissions |