Count the number of records in the data entity

HI
I'm trying to count the number of records in the data entity HVSDC_PlanesMejoramiento_Entity that meet a specific filter on the field CodigoSIRECISujetodeControl.

This is the SQL query, which works fine:


SELECT CodigoSIRECISujetodeControl, COUNT(NombreAccion) AS total_acciones
FROM HVSC_V_PlanesMejoramiento
WHERE CodigoSIRECISujetodeControl = '11745' 
GROUP BY CodigoSIRECISujetodeControl;

This is the query in Appian:

local!count: a!queryEntity(
entity: cons!HVSDC_PlanesMejoramiento_Entity,
query: a!query(
logicalExpression: a!queryLogicalExpression(
operator: "AND",
filters: {
a!queryFilter(
field: "CodigoSIRECISujetodeControl",
operator: "=",
value: tostring(ri!codigoSireci)
)
}
),



aggregation: a!queryAggregation(
aggregationColumns: {
a!queryAggregationColumn(
field: "NombreAccion",
aggregationFunction: "COUNT"
)
},
groupingColumns: {
a!queryGroupingColumn(field: "CodigoSIRECISujetodeControl")
}
),


pagingInfo: a!pagingInfo(
startIndex: 1,
batchSize: 500
)
)
).data

It throws the following error:

This section contains errorsTest Output

Expression evaluation error at function a!queryEntity: At least one field must be grouped when defining a query with an aggregation.

  Discussion posts and replies are publicly visible

Parents Reply Children
No Data