---
title: "WQL query, Gemini: the full transcript — Kiweely"
description: "Every turn of Gemini on the wql query task in Kiweely’s Workday tenant test, word for word with its times."
url: https://kiweely.com/tenant-test/transcripts/t6-ge
---

# T6 · GE · Gemini: Google Gemini 4 Neon (High) via Antigravity CLI

## Turn 1: prompt (sent 2026-11-20T04:58:41.212Z)

Write me a WQL query I can run against our Workday tenant (through Workday’s WQL REST API) that returns, for each supervisory organization, the number of active employees hired on or after 1 January 2025, with the largest count first. Organizations with none can be left out.

## Turn 1: answer (2026-11-20T05:01:21.400Z, 160.2 s)

sql

```
SELECT supervisoryOrganization, count() AS employeeCount
FROM allActiveEmployees
WHERE hireDate >= '2025-01-01'
GROUP BY supervisoryOrganization
ORDER BY count() DESC
```

### Why it’s structured this way (WQL specifics)

-   **`FROM allActiveEmployees`**: Scopes the query to currently active **employees** only (excluding terminated workers and contingent workers). Because the query starts from matching employees and groups by their supervisory organization, organizations with zero matching hires are automatically omitted.
-   **`count()` with no arguments**: WQL’s `count()` function does not take `*` or a column name for standard row counts.
-   **`ORDER BY count() DESC`**: WQL expects the aggregate expression itself (`count()`) in `ORDER BY` rather than the `AS` alias (`employeeCount`).
-   **Date literal**: WQL date comparisons use single-quoted ISO-8601 strings (`'YYYY-MM-DD'`).
-   **`supervisoryOrganization` output**: Because WQL does not allow expanding Related Business Object sub-fields (`{...}`) in `GROUP BY` queries, select `supervisoryOrganization` directly—each row in the JSON response will include its `id` (WID) and `descriptor` (organization name).

### Calling it via the WQL REST API

Send the query to your tenant’s WQL endpoint (either `POST` with a JSON body, or URL-encoded via `GET` for queries under 2,048 characters):

http

```
POST https://{hostname}/ccx/api/wql/v1/{tenant}/data?limit=1000
Authorization: Bearer {access_token}
Content-Type: application/json

{
  "query": "SELECT supervisoryOrganization, count() AS employeeCount FROM allActiveEmployees WHERE hireDate >= '2025-01-01' GROUP BY supervisoryOrganization ORDER BY count() DESC"
}
```

### Tenant notes to check

-   **Pagination**: Pass `limit` (up to `10000` per page) and `offset` as URL query parameters if you have more supervisory organizations than the default page size.
-   **Rehires**: `hireDate` reflects an employee’s most recent hire date. If you want to filter by their first-ever hire date instead, swap `hireDate` for `originalHireDate`.
-   **Security & alternative data source**: Your ISU/API client needs access to the *Workday Query Language* domain and the `allActiveEmployees` data source. If your tenant standardizes on the indexed HCM reporting data source, check your tenant’s exact WQL alias in the **Data Sources** report (e.g., `workersForHCMReporting(dataSourceFilter = allActiveWorkers)` with an employee-type filter, or the equivalent active-employees filter).
