I have a grid shows table data, but it has duplicate record in my grid? Can someone help me?

a!gridField(
label: "Task Metrics",
emptyGridMessage: "No Metrics To Display",
initialSorts: a!sortInfo(field: "metricdate", ascending: false),
data: a!queryEntity(
entity: cons!IC_P_ENTITY_TASK_SUMMARY_METRICS,
query: a!query(
pagingInfo: fv!pagingInfo,
aggregation: if(
ri!groupDCs,
a!queryAggregation(
aggregationColumns: {
a!queryAggregationColumn(
field: "shift",
isGrouping: true
),
a!queryAggregationColumn(
field: "metricdate",
isGrouping: true
),
a!queryAggregationColumn(
field: "totaltasks",
aggregationFunction: "SUM"
),
a!queryAggregationColumn(
field: "assignedtasks",
aggregationFunction: "SUM"
),
a!queryAggregationColumn(
field: "opentasks",
aggregationFunction: "SUM"
),a!queryAggregationColumn(
field: "closedtasks",
aggregationFunction: "SUM"
)
}
),
{}
),
logicalExpression: a!queryLogicalExpression(
operator: "AND",
filters: {
a!queryFilter(
field: "tasksummaryid",
operator: ">",
value: 0
),
a!queryFilter(
field: "shift",
operator: "in",
value: ri!selectedShifts,
applyWhen: not(isnull(ri!selectedShifts))
),
a!queryFilter(
field: "dc",
operator: "in",
value: ri!selectedDCs,
applyWhen: not(isnull(ri!selectedDCs))
),
a!queryFilter(
field: "metricdate",
operator: ">",
value: ri!startDate,
applyWhen: not(isnull(ri!startDate))
),
a!queryFilter(
field: "metricdate",
operator: "<=",
value: ri!endDate,
applyWhen: not(isnull(ri!endDate))
)
}
)
),
fetchTotalCount: true
),
columns: {
a!gridColumn(
label: "Metric Date",
value: fv!row.metricdate,
sortField: "metricdate"
),
a!gridColumn(
label: "Shift & Time",
value:

fv!row.shift
,
sortField: "shift"
),
a!gridColumn(
label: "Total Tasks",
value: fv!row.totaltasks,
sortField: "totaltasks"
),
a!gridColumn(
label: "Assigned Tasks",
value: fv!row.assignedtasks,
sortField: "assignedtasks"
),
a!gridColumn(
label: "Open Tasks",
value: fv!row.opentasks,
sortField: "opentasks"
),
a!gridColumn(
label: "Closed Tasks",
value: fv!row.closedtasks,
sortField: "closedtasks"
),
a!gridColumn(
label: "DC",
value: fv!row.dc,
sortField: "dc",
showWhen: not(ri!groupDCs)
)
}
)

Here is the data in database:

It shows around 40 records of     (13-MAY-20 , Night Shift 7am) in UI, But in table it is only has 18 records.

Can anyone give me some help for this?

  Discussion posts and replies are publicly visible