Why SUM() on bonusAndOne_TimePayments Throws Empty Required Parm Moment_Parm
When aggregating currency fields with SUM() and grouping by a dimension on compensation data sources such as bonusAndOne_TimePayments, Workday Query Language (WQL) can fail with HTTP status 500 or 400 and error code S24:
{
"caseId": "c53ea85a-8d16-44c1-a504-9406bec721d3",
"code": "S24",
"error": "Empty Required Parm Moment_Parm (21$9232)\nXpressO Call Stack Trace=\n86$568030:1$35847, 86$701696:866$6, 86$714079:866$6, 86$554745:866$6, 34$33600, 86$1:866$6"
}This error surfaces on queries that aggregate a currency field (paymentAmount) alongside an instance field (one_TimePaymentPlan) over a date-bounded data source:
SELECT SUM(paymentAmount) AS paymentAmount, one_TimePaymentPlan AS paymentType
FROM bonusAndOne_TimePayments (startDate = '2026-01-01', endDate = '2026-12-31')
WHERE employee IN (3aa5550b7fe348b98d7b5741afc65534)
AND one_TimePaymentPlan IN (
'bb44c6e34f744f4b84004dc53e33a394',
'40e7344f49b301c2ae97c30bd23d8604',
'e005b0c2aea7460a9c71ab65e9918212'
)
GROUP BY one_TimePaymentPlanIn Workday’s underlying reporting engine, paymentAmount is a Currency field rather than a plain Numeric scalar. Each row carries both a numeric amount and a currency code ({"currency": "USD", "value": "371.06"}). When WQL summarizes currency values across grouped instances, the internal XpressO aggregation routine evaluates currency context as of a specific effective moment (Moment_Parm, internal identifier 21$9232).
When the data source uses range prompts (startDate and endDate) rather than a single effective date parameter, an internal WQL regression caused the grouped currency aggregator to invoke the currency conversion routine with an unpopulated Moment_Parm. Removing SUM(paymentAmount) or removing the grouped one_TimePaymentPlan dimension bypassed the grouped currency aggregation path, which is why the ungrouped query continued to work while the grouped SUM() failed.
Why Arithmetic Calculated Fields Do Not Bypass Moment_Parm
A common troubleshooting instinct when SUM() fails on a currency field is to wrap paymentAmount inside an Arithmetic Calculation calculated field (paymentAmount * 1, aliased as cf_ac_paymentAmountAsNumber) and sum the calculated field instead:
SELECT SUM(cf_ac_paymentAmountAsNumber), one_TimePaymentPlan
FROM bonusAndOne_TimePayments (startDate = '2026-01-01', endDate = '2026-12-31')
WHERE employee IN (3aa5550b7fe348b98d7b5741afc65534)
AND one_TimePaymentPlan IN (
40e7344f49b301c2ae97c30bd23d8604,
e005b0c2aea7460a9c71ab65e9918212,
bb44c6e34f744f4b84004dc53e33a394
)
GROUP BY one_TimePaymentPlanThis still returns Empty Required Parm Moment_Parm (21$9232). Even when an Arithmetic Calculation outputs a numeric type, evaluating paymentAmount inside the calculation tree still triggers the underlying currency field getter on the One-Time Payment business object. Similarly, building the exact same summary in a custom report and running Convert Report to WQL produces a WQL statement that includes GROUP BY one_TimePaymentPlan, paymentAmount, which fails on the same internal parameter check.
Note also that WQL’s GROUP BY clause explicitly prohibits grouping by currency fields directly. If Convert Report to WQL appends a currency field such as paymentAmount to the GROUP BY list, remove paymentAmount from GROUP BY so only the dimension field (one_TimePaymentPlan) remains.
How to Structure the Query and Aggregate Resiliently
Workday patched the underlying WQL Moment_Parm defect for bonusAndOne_TimePayments so that standard SUM(paymentAmount) queries return grouped currency objects cleanly:
{
"data": [
{
"paymentAmount": {
"currency": "USD",
"value": "371.06"
},
"paymentType": {
"descriptor": "Relocation",
"id": "40e7344f49b301c2ae97c30bd23d8604"
}
},
{
"paymentAmount": {
"currency": "USD",
"value": "3403.92"
},
"paymentType": {
"descriptor": "Retention Incentive",
"id": "e005b0c2aea7460a9c71ab65e9918212"
}
},
{
"paymentAmount": {
"currency": "USD",
"value": "11477.83"
},
"paymentType": {
"descriptor": "Spot Bonus",
"id": "bb44c6e34f744f4b84004dc53e33a394"
}
}
],
"total": 3
}However, if you encounter Empty Required Parm Moment_Parm (21$9232) on another compensation, payroll, or multi-currency data source where WQL’s internal aggregator cannot resolve a currency moment, you have two reliable options.
Option 1: Pass an Explicit Effective Date When the Data Source Supports It
Inspect the data source metadata via GET /wql/v1/dataSources/{ID} to check whether it accepts effectiveAsOfDate or a moment prompt in the FROM or PARAMETERS clause. Supplying an explicit effectiveAsOfDate satisfies the internal moment requirement on data sources that expose it:
SELECT SUM(paymentAmount) AS paymentAmount, one_TimePaymentPlan AS paymentType
FROM bonusAndOne_TimePayments (
startDate = '2026-01-01',
endDate = '2026-12-31'
)
WHERE employee IN (3aa5550b7fe348b98d7b5741afc65534)
AND paymentAmount IS NOT EMPTY
GROUP BY one_TimePaymentPlanAlways include AND paymentAmount IS NOT EMPTY when summing optional currency fields so null entries do not interfere with currency code resolution across grouped rows.
Option 2: Fetch Ungrouped Payment Rows and Aggregate in PMD or Orchestrate
Because a single worker or small cohort typically has only a handful of one-time payment events in a calendar year, fetching the individual rows without SUM() or GROUP BY completely avoids WQL’s grouped currency aggregation path:
SELECT paymentAmount, one_TimePaymentPlan AS paymentType, paymentDate
FROM bonusAndOne_TimePayments (startDate = '2026-01-01', endDate = '2026-12-31')
WHERE employee IN (3aa5550b7fe348b98d7b5741afc65534)
AND one_TimePaymentPlan IN (
'bb44c6e34f744f4b84004dc53e33a394',
'40e7344f49b301c2ae97c30bd23d8604',
'e005b0c2aea7460a9c71ab65e9918212'
)In a PMD script, you can then group and sum paymentAmount.value by paymentType.id while preserving the currency code:
var rows = getOneTimePayments.data ?? [];
var totalsByPlan = {:};
for (var row : rows) {
if (!empty row.paymentAmount && !empty row.paymentType) {
var planId = row.paymentType.id;
var amount = number:convertStringToDecimal(row.paymentAmount.value);
if (empty totalsByPlan[planId]) {
totalsByPlan[planId] = {
"id": planId,
"descriptor": row.paymentType.descriptor,
"currency": row.paymentAmount.currency,
"total": amount
};
} else {
totalsByPlan[planId].total = totalsByPlan[planId].total + amount;
}
}
}How to Verify in the Tenant
- Open the View WQL Query Result task in your Workday tenant.
- Paste the ungrouped
SELECT paymentAmount, one_TimePaymentPlanquery first and confirm that rows return with validcurrencyandvaluepairs. - Add
SUM(paymentAmount)andGROUP BY one_TimePaymentPlan(ensuringpaymentAmountitself is not listed in theGROUP BYclause) and run the query again. - If the tenant returns
S24withEmpty Required Parm Moment_Parm (21$9232), checkGET /wql/v1/dataSources/{ID}in REST API Explorer for required or optional date/moment parameters, or switch the orchestration/PMD endpoint to the ungrouped query and sum the numeric values in your application logic.