Contact Centers, CRM Customer Engagement

 View Only
  • 1.  Vector Interval report - aggregating data

    Posted 07-15-2019 01:45 PM
    ​Hi,

    I'm trying to create a CMS Supervisor (R18) Vector report (hvector table) that shows data by 30-minute interval, aggregated across multiple dates. I have similar reports at the skill level and they work fine. The query syntax in the SELECT, and WHERE clauses is structured the same as in my skill-interval reports. I found my way past the dreaded "Group by" and columns issue.  I understand about specifying "multi" for the inputs and my queries appear to run properly, but the vector report will only provide data for the last date in whatever range I enter. It doesn't aggregate for the range of dates.

    For example, if I run the report for dates "07/05/19 - 07/12/19" and for just 07/12/19, I get exactly the same results. That's a random example, it'd be true for any range I use.

    Has anyone else seen this? Better yet - has anyone else gotten past it?

    Thanks,
    Steve

    ------------------------------
    Steve Charloff
    Manager, Coding Content Client Support
    Optum360
    ------------------------------


  • 2.  RE: Vector Interval report - aggregating data

    Posted 07-16-2019 02:07 AM

    Any chance you could post the query here? It sounds like you have a conflict in your WHERE, GROUP BY, HAVING clauses.


    Thank you

    Christopher Williams
    Architect, Telephony Engineering


    CONFIDENTIALITY NOTICE: This e-mail, including attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information or otherwise be protected by law. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and destroy all copies and the original message.





  • 3.  RE: Vector Interval report - aggregating data

    Posted 07-16-2019 08:33 AM
    Certainly, and thanks for the help.

    The query is simple, because I'm really just trying to identify call volumes that flow out of the vector, so I trimmed out as much as possible to reduce the hiding places for errors.

    Here's the Data query (and it's all set to point to the hvector table):​ 
    SELECT STARTTIME, '-', STARTTIME+INTRVL, SUM(INCALLS), SUM(INFLOWCALLS), SUM(OUTFLOWCALLS)
    FROM hvector
    WHERE ROW_DATE = [Dates:] AND  STARTTIME = [Times:] AND  VECTOR = [Vector:] AND ACD=$acd GROUP BY 1,  3 ORDER BY STARTTIME

    and here's the Totals query:
    SELECT 'Totals', '', '', sum(hvector.INCALLS), sum(hvector.INFLOWCALLS), sum(hvector.OUTFLOWCALLS)
    FROM hvector
    WHERE ACD=$acd AND  ROW_DATE = [Dates:] AND  STARTTIME = [Times:] AND  VECTOR = [Vector:]

    Hopefully, I've made an error that isn't too bitterly stupid, since my SQL is self-taught. (For example: what's a HAVING clause?) Any suggestions you can offer will be much appreciated!

    Thanks,
    Steve

    ------------------------------
    Steve Charloff
    Manager, Online Solutions Support
    Optum360
    ------------------------------



  • 4.  RE: Vector Interval report - aggregating data

    Posted 07-16-2019 10:29 AM

    First, let me say-my background is in AACC (and SQL) and not Elite/CMS. So the following lengthy reply may be unhelpful and I've prioritized the order of this response from what I think is the most important piece of information to the least, that way if you get bored at any point and stop reading, as long as you've read top down, you probably won't be missing anything important.

     

     

    Second, in pure SQL (more on this in #4 below), grouping by time and not including the DATE in your SELECT would limit the output to grouping all times in a date range to a single day.

     

    For example, if you have the dates 7/5 – 7/12, times 8A-5P-but you group by the hour, an SQL report would return 8A-5P as groups (each day in the date range would be summarized. Like saying-Tell me my total calls for the week between 8-9, 9-10, 10-11, etc.)

     

    Your solution might be as simple as adding the date to your SELECT and GROUP BY clauses. (SELECT ROW_DATE, STARTTIME ... GROUP BY 1, 2, 4 ...)

     

    Also, you probably want to ORDER BY ROW_DATE, STARTTIME. (Although the data may often be returned in sequence because of how it is written to the database, it's a good practice in SQL to get in the habit of being specific.)

     

    This will, necessarily, require you to modify your totals query. (So it has the same number of columns as your GROUP BY query.)

     

     

    Third, WHERE and HAVING are similar in SQL. WHERE evaluates per-row, whereas HAVING evaluates per-group. Changing WHERE will change what content to include in your groups, changing HAVING will change which groups to return. An example would be if you wanted to do an agent report, you could group by first(agent), avg(acdtime) and return groups having acdtime>12 minutes. This would give you a list of with high average talk time (assuming 12 minutes talk time is high in your environment.) If you added a WHERE ACDCALLS > 0 clause, it will omit any rows where the agent took no calls (as the average will be reduced when including idle intervals. This will tend to bump up the average. Maths.)

     

     

    Fourth, I'm not entirely positive there isn't an interpreter at work before the SQL query is processed. I've seen this kind of syntax before in a report writing system but not in raw SQL. In SQL you would use ROW_DATE BETWEEN STARTTIME AND ?ENDTIME? instead of ROW_DATE = [Dates:]. An acceptable SQL alternative would be (ROW_DATE >= STARTIME AND ROW_DATE < ?ENDTIME?)

     

    Having said that, I did some google searches and found several community support threads where ROW_DATE = [Dates:] was reported to be the correct syntax. (Thus, my arriving at the conclusion that this is possibly working with a pre-SQL interpreter.)

     

    Likewise, instead of VECTOR = [Vector:], in SQL you would say VECTOR IN {variable,[list,...]}

     

    If VECTOR IN [101,102, 201, 301], return the row. This works for a list of discrete entities, not so much date and time.

    Thank you

    Christopher Williams
    Architect, Telephony Engineering

     

    CONFIDENTIALITY NOTICE: This e-mail, including attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information or otherwise be protected by law. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and destroy all copies and the original message.





  • 5.  RE: Vector Interval report - aggregating data

    Posted 07-16-2019 11:10 AM
    Thank you for the advice. But I'm afraid that's not the solution.

    First: getting my total calls for the week for each 30-minute period ("Intrvl") is exactly what I'm after. I don't want it also broken out by days​, although if that's the only way I can get it I'd take it, because I can bring it into an Excel pivot table and summarize by time slot there.

    But when I added ROW_DATE to the SELECT and GROUP BY clauses, the query just runs forever - both with and without adding ROW_DATE to the ORDER BY clause.

    Very strange.  Thanks again.

    ------------------------------
    Steve Charloff
    Manager, Online Solutions Support
    Optum360
    ------------------------------



  • 6.  RE: Vector Interval report - aggregating data

    Posted 07-16-2019 11:51 AM

    Ah, then I misunderstood your objective. If you want summary by half-hour for a set of days in given range, then SELECT and GROUP BY look correct to me.

    Thanks for clarifying.

     

    Without more understanding about WHERE clause handling of input variables in CMS queries, I'm afraid I've reached the limit of my knowledge.

    (That's where I think the problem is.)

    Hopefully someone else with more CMS experience will weigh in here.

     

    Alternately, you might also try the Avaya support forums if the community here does not reply.

     

     

    Good luck. I hope to see the solution here.

    Thank you

    Christopher Williams
    Architect, Telephony Engineering

     

    CONFIDENTIALITY NOTICE: This e-mail, including attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information or otherwise be protected by law. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and destroy all copies and the original message.





  • 7.  RE: Vector Interval report - aggregating data

    Posted 07-18-2019 10:42 AM
    Steve, Give me a call, 904-279-6338 (EDT).  I have a report working that I think does what you are looking for and maybe we can compare the query.

    ------------------------------
    [John] [Conlon]
    [Voice Engineer]
    [CSX/Verizon Professional Services]
    [Jacksonville] [FL]
    [904-279-6338]
    ------------------------------