Hi Community,
I want to perform count() operation on a column. And also remove duplicates in query aggregation. But i can't able to use both at same time. Im getting duplicates for subject id.
{101,1},
{102,1},
{103,2}
here i want the count of deptId as 2 but im getting count as 3
aggregation: a!queryAggregation( aggregationColumns: { a!queryAggregationColumn( field: "EmployeeID", isGrouping: true ), a!queryAggregationColumn( field: "deptID", aggregationFunction: "COUNT"
)
} ),
Discussion posts and replies are publicly visible
Hi SangeethaBabu
In case you need an output like {{deptID:1, count:2},{deptID:2,count:1}} you need to modify your aggregation logic. You could use the below code instead:
aggregation: a!queryAggregation( aggregationColumns: { a!queryAggregationColumn( field: "deptID", alias: "deptID" isGrouping: true ), a!queryAggregationColumn( field: "deptID", alias:"count", aggregationFunction: "COUNT"
})
Let me know if this helps.
Hi SmitaA
But i want to use this for column chart. Can you tell me how to achieve it?. When I used the above logic Im getting separte column for each request
Could you please provide more information as to what is the x-axis and y-axis column of the column chart you want to build.
Also what do you mean by each request as stated above.