Chat average wait time calculation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2014 06:35 AM
Hi,
This is my first time implementing the chat functionality in SN.
I have a question around the Business Rule SNC - Chat Queue Average Wait Time
Has anyone built the average wait time business rule to set this based on the calls in the past hour rather than the last 20 calls.
So check how many calls in the last hour, check the wait time for each, then calculate the average?
As always, Any help is much appreciated!
- Labels:
-
Ask the Expert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2018 09:39 AM
I think you're right.
It only calculates the average per queue and the widget only shows ONE queue.
We have four queues and this widget only shows one, unfortunately for us the queue we have as default is the one with the longest wait time.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2022 06:06 AM
Hi,
The calculation itself is started by the OOB business rule "Calculate Avg Wait Time for Queue" from the "interaction" table.
Within this business rule it's using the function "refreshAvgWaitTime()" which is actually a function from a back-end Java file.
This Java function computes the average wait time as following:
1) Get the latest 20 "interaction" (the table that keeps track of the walk-up requests) records where state = Work in Progress for a particular queue location
2) Get their "wait_time" values
3) Add all of these up and divide it by 20 (or whatever valid records available at the time based on the query; i.e. if you only have 5 interaction records where state = Work in progress then it'll divide it by 5 only)
4) The resulting value would be the average which will then be updated to the "Average wait time" field on the location queue record (wu_location_queue)
Regards,
Nayan