One quick comment (not a complete answer)...
The IWRKGRPQUEUESTATS table is for statistics grouped by time period for the queues. Those stats
will not match the individual call details logged in the call details tables.
Stats are very different from call details, especially counting calls on queues, since a call might enter a queue during one period, and get answered or disconnect during a different time period, or be transferred to another queue and thus shows as a separate call on two different queues for stats...lots of possibilities.
To get exactly what you want, you may need to write a custom report to pull from the call details data, which is raw data rather than stats averaged over time.