Regarding a use case on queries in Druid

I have a use case in druid where real-time data comes in the format like,

task{

taskno;

category;

}

Here category can be “assigned” or “unassigned”.Suppose tasks with the following came,

taskno:1,category:“assigned”

taskno:2,category:“unassigned”

taskno:3,category:“assigned”

taskno:4,category:“assigned”

Here if I perform a query with filter as “category” with count(*) on it ,I will get result as;

assigned:3

unassigned:1

Now a new event comes with

taskno:2,category:“assigned”

I want in such a way that the query results

assigned:4

unassigned:0

Is there any way I can do like this using UDF or something in druid?

Thanks.