You group both times by the same columns, if i understodd you correctly you have to group by date/hour first and then by weekday:
SELECT
creation_dt (FORMAT 'eee') (CHAR(3))
,AVG(CASE WHEN "hour" = 0 THEN cnt END) AS "00:00"
,AVG(CASE WHEN "hour" = 1 THEN cnt END) AS "01:00"
,AVG(CASE WHEN "hour" = 2 THEN cnt END) AS "02:00"
...
FROM
(
SELECT
CAST(creation_ts AS DATE) AS creation_dt
,EXTRACT(HOUR FROM creation_ts) AS "hour"
,COUNT(*) AS cnt
FROM calls_table
GROUP BY 1,2
) AS dt
GROUP BY 1
Dieter
You group both times by the same columns, if i understodd you correctly you have to group by date/hour first and then by weekday:
Dieter