Tareas #4803
open
  
    
    
  
reporte de citas y entrevistas por canal
 
        
        Added by Jose Orlando over 1 year ago.
        Updated over 1 year ago.
        
  
  
  
  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
  
 
  
  
    
    
    
    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
 
   
  
  
    
    
    
    
      
    
A revision
 
   
  
  
  
  
    
    
    
    
       - Status changed from Nueva to Resuelta
 
   
  
 
  
  
 
Also available in:  Atom
  PDF