Skip to content
KiweelyKiweelyKiweely

Workday WQL Alias Naming Rules and Restrictions

In Workday Query Language (WQL), aliases identify data sources, filters, parameters, and fields, or rename output columns with AS. Custom AS aliases cannot use WQL keywords or escape characters, require quotes around spaces or special characters, and duplicate aliases return only the first field.

  • Checked against Workday on
  • Applies to Workday Extend
  • 7 min read
  • Published
  • By Kiweely
On this page

In Workday Query Language (WQL), an alias is either the internal identifier Workday assigns to a data source, filter, parameter, or field, or a custom column name you assign with AS in a SELECT clause. Custom AS aliases cannot be WQL reserved keywords, do not support escape characters, require single or double quotes whenever they contain spaces or special characters, and cannot be reused across two columns because WQL returns only the first matching field.

Allowed characters, quoting, and length limits for WQL aliases

Workday enforces different naming constraints depending on whether you are referencing an existing object alias or declaring an output column alias with AS.

For custom AS column aliases in a SELECT clause, unquoted names work cleanly with letters, digits, and underscores (starting with a letter, following camelCase or snake_case conventions). When a custom AS alias contains spaces or special characters, you must wrap it in single quotes (') or double quotes ("). Workday’s SELECT reference documents support for these special characters inside quotes:

text
~  @  $  *  -  _  /  ?  :  ;

Two hard syntax restrictions apply to every custom AS alias:

  • No escape characters: WQL does not support escape character syntax (such as backslashes or backticks) inside aliases. If an alias needs a quote character inside it, avoid that character rather than trying to escape it.
  • No reserved keywords: You cannot use a WQL keyword as a custom alias.

Field and calculated field identifiers in SELECT, FROM, and WHERE are case-sensitive. A calculated field alias such as cf_securityGroupName fails if written as cf_SecurityGroupName.

Workday does not publish a numeric maximum character length for an individual WQL column alias or a calculated field’s WQL Alias Name in its public WQL documentation. Test long alias names in a Sandbox or Implementation tenant before relying on them in an integration. At the query level, GET /data caps the full WQL query string at 2,048 characters, while POST /data accepts queries between 2,048 and 16,000 characters.

WQL alias types and restrictions compared

Practitioners run into alias errors when they mix up the five places where Workday generates or accepts WQL aliases. Each type has its own source and editability rules.

Alias type Where it appears Editable? Key naming rules and behavior
Alias typeData source alias Where it appearsFROM clause Editable?No (system-generated) Key naming rules and behaviorEvery Workday-delivered reporting data source has a fixed alias (such as allWorkers or workersForHCMReporting).
Alias typeStandard field alias Where it appearsSELECT, WHERE, GROUP BY, ORDER BY Editable?No (system-generated) Key naming rules and behaviorCase-sensitive camelCase identifier (such as businessTitle, yearsOfService). Must be authorized for Report Writer or default areas.
Alias typeCalculated field WQL Alias Name Where it appearsSELECT, WHERE, GROUP BY, ORDER BY Editable?Yes (Edit Calculated Field) Key naming rules and behaviorAuto-generated by Workday for delivered and custom calculated fields (commonly prefixed with cf_). Can be edited, and case must match exactly in queries.
Alias typeCustom column alias (AS) Where it appearsSELECT clause Editable?Yes (in query text) Key naming rules and behaviorRenames the JSON key returned in the response. Cannot be a WQL keyword, no escape characters, requires '...' or "..." for spaces or special characters.
Alias typeReport-converted alias Where it appearsOutput of Convert Report to WQL Editable?Indirectly (via report columns) Key naming rules and behaviorWorkday copies Column Heading Override values as AS aliases, and uses Group Column Heading as the alias for related business object fields.
Alias typeWorkday Extend custom object alias Where it appearsFROM and SELECT clauses Editable?Set at object design time Key naming rules and behaviorData source alias is derived from the app Reference ID and the business object’s defaultCollection attribute; viewable in Workday Extend App Manager.

Duplicate aliases behave silently rather than throwing a syntax error. According to Workday’s SELECT reference, if two or more fields resolve to the same alias in a query, WQL returns only the first field defined in Workday and drops the subsequent value.

Reserved WQL keywords you cannot use as aliases

WQL rejects any custom AS alias that matches a WQL clause or operator keyword. The core keywords to keep out of custom aliases include:

  • Clause keywords: PARAMETERS, SELECT, FROM, WHERE, ON, GROUP, BY, HAVING, ORDER, LIMIT, OFFSET
  • Expression and sort keywords: AS, AND, OR, IN, NOT, DISTINCT, ASC, DESC
  • Aggregate function names: AVG, COUNT, MAX, MIN, SUM

If an integration consumer expects a JSON key name that collides with a keyword (for example order or group), rename the alias to a compound identifier such as orderNumber or workerGroup in WQL, or map the key downstream in your integration.

Valid vs. failing WQL alias query examples

The examples below show valid SELECT alias patterns alongside the exact mistakes that cause WQL validation failures.

Valid WQL alias queries

sql
-- Unquoted alphanumeric alias on an aggregate function
SELECT location, MAX(yearsOfService) AS Seniority
FROM allWorkers
GROUP BY location
sql
-- Quoted aliases containing spaces and supported special characters
SELECT
  worker,
  businessTitle AS "Job Title",
  yearsOfService AS "Years-of-Service"
FROM allWorkers
sql
-- Calculated field alias with exact case matching
SELECT
  employeeID,
  cf_primaryWorkEmail AS workEmail
FROM workersForHCMReporting(dataSourceFilter=allActiveWorkers)

Failing WQL alias queries

sql
-- FAILS: uses a reserved WQL keyword (GROUP) as an alias
SELECT location AS GROUP
FROM allWorkers
sql
-- FAILS: space in an unquoted alias
SELECT businessTitle AS Job Title
FROM allWorkers
sql
-- FAILS: uses escape character syntax, which WQL does not support
SELECT businessTitle AS "Job\"Title"
FROM allWorkers
sql
-- FAILS: wildcard selection is not supported in WQL
SELECT *
FROM allWorkers
sql
-- SILENT DATA LOSS: duplicate alias returns only the first field
SELECT firstName AS name, lastName AS name
FROM allWorkers

How to look up and edit WQL aliases in Workday

Never guess a field or data source alias from its UI label. Workday provides four direct ways to verify exact alias names before running a query.

  1. Inspect or edit a calculated field alias: Run the Edit Calculated Field task (or open the field’s Related Actions menu and choose Calculated Field > Edit). Check or update the WQL Alias Name field under the additional information section. Any existing WQL query or integration referencing the previous alias will break as soon as you change it.
  2. Look up data sources and fields in the UI: Open the WQL Data Sources report or create a custom report on the Data Sources or Fields report data source and include the WQL Alias report field. That custom report returns WQL aliases only for data sources that Workday has enabled for reporting. You can also view the WQL alias from the Related Actions menu on an individual field, calculated field, or data source.
  3. Generate a baseline query from an existing report: Run the Convert Report to WQL report (requires security access to the Workday Query Language domain in the System functional area) against an Advanced or Matrix report. Workday outputs the converted WQL query, maps any Column Heading Override or Group Column Heading values into AS aliases, and lists any report components that cannot convert to WQL.
  4. Query the WQL metadata REST API: Use the WQL REST endpoints to retrieve the exact strings the tenant expects:
    • GET {baseURL}/dataSources (filter with the alias query parameter to get the data source WID)
    • GET {baseURL}/dataSources/{WorkdayID} (returns data source details and valid aliases)
    • GET {baseURL}/dataSources/{WorkdayID}/dataSourceFilters (returns filter and prompt aliases)
    • GET {baseURL}/dataSources/{WorkdayID}/fields (returns standard and calculated field aliases)

Use https://{hostname}/api/wql/{version}/{tenant} as {baseURL} for tenanted REST calls, or https://api.workday.com/wql/{version} inside Workday Extend.

Troubleshooting WQL alias errors

Most WQL alias failures surface as one of two error messages: Invalid SELECT clause or Enter a valid report field. This field is invalid: <field_name>. Work through these checks in order to isolate the cause.

  1. Check reserved keywords and unquoted characters (Invalid SELECT clause): Scan every AS alias in the SELECT list. Quote any alias that contains spaces or special characters (-, /, :, $, @), remove any backslash or backtick escape sequences, and replace any alias that matches a WQL keyword (SELECT, FROM, WHERE, GROUP, ORDER, LIMIT, AS).
  2. Verify exact casing on calculated fields (Enter a valid report field): Open the calculated field via Edit Calculated Field and compare the WQL Alias Name character by character against your query. A single uppercase letter mismatch (such as cf_CostCenter instead of cf_costCenter) triggers an invalid field error.
  3. Check for stale aliases after report edits: If the query came from Convert Report to WQL, check whether someone edited the underlying calculated field’s WQL Alias Name or changed a Column Heading Override or Group Column Heading on the source report. Re-run Convert Report to WQL or verify the field list with GET /dataSources/{WorkdayID}/fields.
  4. Confirm field authorization and security permissions: WQL only exposes fields authorized for Workday Report Writer or default areas, and only when the executing Workday account or integration system user has domain security policy access to both the data source and every requested field. A missing domain permission on a single calculated field can make that field appear invalid in SELECT.
  5. Check for missing columns caused by duplicate aliases: If the query returns HTTP 200 without an error but an expected field is absent from the JSON payload, inspect the SELECT clause for two columns sharing the same alias or the same AS rename. Give every selected column a distinct alias so WQL returns all of them.

Sources checked

Run WQL against your real tenant.

Kiweely Vine inspects your tenant's data sources and fields, runs the query under your Workday security, and verifies the rows returned.

Get the next guide in your inbox.

One email a month with new guides and one Extend tip. Nothing else.

We’ll email you once to confirm. Unsubscribe in one click from any issue.

Protected by reCAPTCHA. Google’s privacy policy and terms apply.