Hello
I used your script to create a view in SQL like :
create view community
as select count(a.id) as Total_No,b.last_name,a.status from call_req a, ca_contact b
where a.group_id= b.contact_uuid
and b.contact_type=2308
group by b.last_name,a.status
this view is stored in SQL.
I then created a new domain in jasper using this view
in display tab specify fields to be included in your future adhoc view and adhoc report:
click OK and Submit your domain.
Now create an adhoc view using this domain:
here is an example of your query: