I am trying to do some trending over hours during specific days of the week. By this I mean I might want to see how many calls came in (BY HOUR) over the past 3 Days that were the same day name as yesterday's day name (for example, today is Wednesday so I want to see how many calls came in over the past 3 Tuesdays...by HOUR).
Here is what the raw data might be like:
| CallDateTime | CallCount |
|---|
| 7/25/2016 10:00 AM | 4 |
| 7/25/2016 10:05 AM | 3 |
| 7/25/2016 10:30 AM | 2 |
| 7/25/2016 10:00 AM | 3 |
| 7/25/2016 11:05 AM | 2 |
| 7/25/2016 11:45 AM | 3 |
| 7/25/2016 12:05 PM | 2 |
| 8/1/2016 10:05 AM | 5 |
| 8/1/2016 10:25 AM | 2 |
| 8/1/2016 11:30 AM | 1 |
| 8/1/2016 12:15 PM | 4 |
| 8/8/2016 10:15 AM | 3 |
| 8/8/2016 11:45 AM | 3 |
| 8/8/2016 11:55 AM | 4 |
| 8/8/2016 12:35 PM | 2 |
Then I would like for the table of my report to be something like: (I will be eventually put this into a line graph)
CallTime
| CallCount
|
|---|
| 10:00 AM | 22 |
| 11:00 AM | 13 |
| 12:00 PM | 8 |
I believe I already have my filters correctly put into the report: ('yesterday' is a repository variable that we use to always give user yesterday's date)
--"CALL_CENTER"."CALL_START_DATETIME" BETWEEN VALUEOF("yesterday")-14 AND VALUEOF("yesterday")
--DAYOFWEEK("CALL_CENTER"."CALL_START_DATETIME") = DAYOFWEEK(VALUEOF("yesterday"))
Where I run into my problem is...I can't seem to figure out how to get the CallCount to aggregate by HOUR but NOT by DATE.
The formula I use for the hour in CallTime is as follows:
EVALUATE('trunc(%1,%2)' as TimeStamp,"CALL_CENTER"."CALL_START_DATETIME" ,'HH')
I then set a custom format for CallTime to be:
h:mm tt
Cosmetically this gives me what I want for CallTime, but it obviously still has the DATE in it (even though I'm not showing it). So my report ends up repeating Hours and giving CallCount for each of these Date/Times.
I need it to aggregate up for each hour.
Is this possible? And if so, could anyone help steer me in the direction I'd need to go in order to achieve this?
Any help is appreciated!