Tareas #4803
openreporte de citas y entrevistas por canal
0%
Description
filtros:
proyecto
rango de fechas (de la gestion, startdate)
select
ca.name as canal,
'CITAS',
count() as citas,
0 as entrevistas
from c_contactactivity ge
inner join tb_activitytype ta on ta.tb_activitytype_ID = ge.tb_activitytype_ID
inner join c_opportunity op on op.c_opportunity_id = ge.c_opportunity_id
left join c_channel ca on ca.c_channel_id = op.c_channel_id
where ge.ad_client_id = 1000005
and ge.startdate >= '2023-01-01'
and ActivityCategory = 'C'
group by 1,2
UNION
select
ca.name as canal,
'ENTREVISTAS',
0 as citas,
count() as entrevistas
from c_contactactivity ge
inner join tb_activitytype ta on ta.tb_activitytype_ID = ge.tb_activitytype_ID
inner join c_opportunity op on op.c_opportunity_id = ge.c_opportunity_id
left join c_channel ca on ca.c_channel_id = op.c_channel_id
where ge.ad_client_id = 1000005
and ge.startdate >= '2023-01-01'
and ActivityCategory = 'E'
group by 1,2
order by 1,2
Files
Updated by Armando Chuto over 1 year ago
select
ca.name as canal,
'CITAS' as tipo,
count(ge.*) as citas,
0 as entrevistas
from c_contactactivity ge
inner join tb_activitytype ta on ta.tb_activitytype_ID = ge.tb_activitytype_ID
inner join c_opportunity op on op.c_opportunity_id = ge.c_opportunity_id
left join c_channel ca on ca.c_channel_id = op.c_channel_id
where ge.ad_client_id = 1000005 --$P{AD_Client_ID}
and ge.startdate >= COALESCE
and ge.startdate <= COALESCE
and ActivityCategory = 'C'
group by 1,2
UNION
select
ca.name as canal,
'ENTREVISTAS' as tipo,
0 as citas,
count(ge.*) as entrevistas
from c_contactactivity ge
inner join tb_activitytype ta on ta.tb_activitytype_ID = ge.tb_activitytype_ID
inner join c_opportunity op on op.c_opportunity_id = ge.c_opportunity_id
left join c_channel ca on ca.c_channel_id = op.c_channel_id
where ge.ad_client_id =1000005 --$P{AD_Client_ID}
and ge.startdate >= COALESCE
and ge.startdate <= COALESCE
and ActivityCategory = 'E'
group by 1,2
order by 1,2
Updated by Armando Chuto over 1 year ago

A revision
Updated by Armando Chuto over 1 year ago
