SELECT
Returns field values from Workday data sources. Workday Query Language (WQL) requires this clause in all queries.
You can only access fields that:
- Workday has authorized for use with the Workday Report Writer or default areas.
- The current processing Workday account has permission to access.
Syntax
SELECT field1 AS myAlias, function(field2), field1{relatedBusinessObjectField1}, ...fieldN FROM dataSourceAlias
Arguments
Argument | Description |
|---|---|
field1 , field2 , ...fieldN
| The WQL alias for the field you want to access.
If 2 or more fields have the same alias, WQL returns the first field defined in Workday. |
myAlias
|
(Optional) Rename the column header in the response.
Example: SELECT max(yearsOfService) as Seniority You can’t use a WQL keyword as a custom alias. WQL doesn’t support escape character syntax. WQL supports some special characters and spaces in single or double quotes. Examples:
|
function
| (Optional) You can use these aggregation functions with fields:
COUNT() doesn't take any arguments. |
relatedBusinessObjectfield1
| The field of the related business object for which you want to filter results. |
Aggregation Functions
Aggregation Function | Description |
|---|---|
AVG( field ) | Returns the average value of a numeric field. |
COUNT() | Returns the number of instances matching the query criteria. |
COUNT (DISTINCT field ) | Returns the unique number of instances matching the query criteria. Use
only on text and single instance fields. |
MIN( field ) | Returns the minimum value of a field. |
MAX( field ) | Returns the maximum value of a field. |
SUM( field ) | Returns the total sum of a numeric field. |
Example
To return worker information from a data source:
SELECT worker, fullName, location FROM allWorkers
Limitations
WQL doesn't support
SELECT *
.