Statement error

Donald.Modise's profile image Donald.Modise posted 4 weeks ago in General Permalink

Error when running the below code


t.outbound_cli, t.number_name, TO_CHAR(t.start_time, 'yyyy-mm') AS date_andmonth, count() as calls, count() filter (where connect = true) as connects, round(100.0 ( count() filter (where connect = TRUE ) ) / (COUNT(*)),2) AS "connect%", count() filter (where dmc = true) as dmcs, round(100.0 ( count() filter (where dmc = TRUE ) ) / (COUNT()),2)AS "dmc%", count() filter (where sale = true) as sales, round(100.0 ( count() filter (where sale = TRUE ) ) / (COUNT()),2) as CONVERSION, count() filter (where completed = true) as completed, round(100.0 ( count() filter (where completed = TRUE ) ) / (COUNT()),2) AS "completed%" FROM (select i.interaction_id, im.outbound_cli AS outbound_cli, inb.description AS number_name, i.start_time, i.outcome_attributes @> '{answered}' as connect, i.outcome_attributes @> '{dmc}' as dmc, i.outcome_attributes @> '{sale}' as sale, i.outcome_attributes @> '{completed}' as completed, AS

from reporting.interaction_voice i join voice.interactions_meta im on i.interaction_id = im.interaction_id LEFT JOIN reporting.inbound_numbers inb ON im.outbound_cli = inb.inbound_number JOIN campaigns ON i.interaction_id = WHERE im.outbound_cli LIKE '+27%'

AND i.start_time >= CURRENT_DATE - INTERVAL '3 month'

) AS t

group by t.outbound_cli, t.number_name, TO_CHAR(t.start_time, 'yyyy-mm') order BY 1;

ansgar's profile image ansgar posted 4 weeks ago Permalink

You should post the error message at least.

Please login to leave a reply, or register at first.