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)
SELECT supervisoryOrganization, count() AS employeeCount
FROM allActiveEmployees
WHERE hireDate >= '2025-01-01'
GROUP BY supervisoryOrganization
ORDER BY count() DESCWhy 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’scount()function does not take*or a column name for standard row counts.ORDER BY count() DESC: WQL expects the aggregate expression itself (count()) inORDER BYrather than theASalias (employeeCount).- Date literal: WQL date comparisons use single-quoted ISO-8601 strings (
'YYYY-MM-DD'). supervisoryOrganizationoutput: Because WQL does not allow expanding Related Business Object sub-fields ({...}) inGROUP BYqueries, selectsupervisoryOrganizationdirectly—each row in the JSON response will include itsid(WID) anddescriptor(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):
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 to10000per page) andoffsetas URL query parameters if you have more supervisory organizations than the default page size. - Rehires:
hireDatereflects an employee’s most recent hire date. If you want to filter by their first-ever hire date instead, swaphireDatefororiginalHireDate. - Security & alternative data source: Your ISU/API client needs access to the Workday Query Language domain and the
allActiveEmployeesdata 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).