Buongiorno,
ho il seguente problema: ho la seguente tabella pivot:
tabella.jpg
Devo aggiungere una riga con i totali dati dalla somma di ogni colonna.
La tabella in questione è stata ottenuta tramite il codice seguente:
codice: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;
Avete idea di come si possa fare?
Grazie

Rispondi quotando