Buongiorno,
ho il seguente problema: ho la seguente tabella pivot alla quale devo aggiungere una riga finale con i totali dati dalla somma di ogni colonna.
Tale tabella è stata ottenuta tramite il seguente codice:
Non ho la minima idea di come si possa fare.
Potreste aiutarmi?
Grazie
ho il seguente problema: ho la seguente tabella pivot alla quale devo aggiungere una riga finale con i totali dati dalla somma di ogni colonna.
Tale tabella è stata ottenuta tramite il seguente codice:
SQL:
select detailDestinationName as 'Nome Coda',
count(*) as 'Totale Chiamate ricevute',
count(case when status = 'SERVED' then uniqueId else null end) as 'Chiamate Servite',
(count(case when status = 'SERVED' then uniqueId else null end)/count(*)*100) as '% chiamate servite',
ifnull((count(case when status = 'NOTSERVED' and waitingTime >= 30 then uniqueId else null end)/(count(*)-count(case when status = 'NOTSERVED' and waitingTime < 30 then uniqueId else null end))*100),0) as "Totale Abbandoni",
count(case when status = 'NOTSERVED' and waitingTime >= 30 then uniqueId else null end) as 'Chiamate non Servite Superiori a 30 secondi',
ifnull((count(case when status = 'NOTSERVED' and waitingTime >= 30 then uniqueId else null end)/count(case when status = 'NOTSERVED' then uniqueId else null end )*100),0) as '% chiamate non servite superiore a 30 secondi',
count(case when status = 'NOTSERVED' and waitingTime < 30 then uniqueId else null end) as 'Chiamate non Servite Inferiori a 30 secondi',
ifnull((count(case when status = 'NOTSERVED' and waitingTime < 30 then uniqueId else null end)/count(case when status = 'NOTSERVED' then uniqueId else null end )*100),0) as '% chiamate non servite inferiore a 30 secondi'
from chiamate_report_new
group by detailDestinationId;
Non ho la minima idea di come si possa fare.
Potreste aiutarmi?
Grazie