<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Aggregating Call Detail Records Per Call ID in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggregating-Call-Detail-Records-Per-Call-ID/m-p/246454#M496043</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not know whether anybody has delt with such a problem in the past, but it is a classical problem in telecoms world. Maching call detail records per call id.&lt;/P&gt;&lt;P&gt;In more detail:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a bunch of call detail records that record that start of the call, the end of the call, and all the events during the call. As you can imagine, these are separate records. Many records per call. Each call is identified by the call_id. Here is the structure of each record:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;call_event_datetime, call_id, queue, agent, verb&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have these events stored in a QVD file (after having fetched them from a MySQL database). And they are quite a lot. 20K records per day. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The point here is that I want to answer questions like the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"AVERAGE CALL LENGTH on a Daily Basis"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the best way to do that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One could say. Go and build a table like the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;call_id, start_datetime, end_datetime, call_length&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The calculate the AVERAGE on call_length after selecting the calls on a daily basis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is that the solution? And how do I create such a table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shall I approach this problem completely differently?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Feb 2012 07:46:26 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-02-02T07:46:26Z</dc:date>
    <item>
      <title>Aggregating Call Detail Records Per Call ID</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregating-Call-Detail-Records-Per-Call-ID/m-p/246454#M496043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not know whether anybody has delt with such a problem in the past, but it is a classical problem in telecoms world. Maching call detail records per call id.&lt;/P&gt;&lt;P&gt;In more detail:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a bunch of call detail records that record that start of the call, the end of the call, and all the events during the call. As you can imagine, these are separate records. Many records per call. Each call is identified by the call_id. Here is the structure of each record:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;call_event_datetime, call_id, queue, agent, verb&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have these events stored in a QVD file (after having fetched them from a MySQL database). And they are quite a lot. 20K records per day. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The point here is that I want to answer questions like the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"AVERAGE CALL LENGTH on a Daily Basis"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the best way to do that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One could say. Go and build a table like the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;call_id, start_datetime, end_datetime, call_length&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The calculate the AVERAGE on call_length after selecting the calls on a daily basis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is that the solution? And how do I create such a table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shall I approach this problem completely differently?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Feb 2012 07:46:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregating-Call-Detail-Records-Per-Call-ID/m-p/246454#M496043</guid>
      <dc:creator />
      <dc:date>2012-02-02T07:46:26Z</dc:date>
    </item>
    <item>
      <title>Aggregating Call Detail Records Per Call ID</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregating-Call-Detail-Records-Per-Call-ID/m-p/246455#M496044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Panagiotis, why don't you aggregate date based on the keys you define on a new QVD file? Then you can use Average formaulas on a graph layout object where you display the data. Diamantis.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2012 19:05:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregating-Call-Detail-Records-Per-Call-ID/m-p/246455#M496044</guid>
      <dc:creator />
      <dc:date>2012-03-15T19:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregating Call Detail Records Per Call ID</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregating-Call-Detail-Records-Per-Call-ID/m-p/246456#M496045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assume that field "verb" identifes the event like "CallStart", "CallEnd", etc. There are at least a couple of approaches. You are correct in assuming that's it's best to build up a singe row for each call. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A simple approach is use a series of JOINs selecting each relevant event type in turn, and then doing a subtraction of the new fields to derive the duration. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Calls:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; call_id, queue, agent,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; call_event_datetime as Start_datetime&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;RESIDENT CDR.qvd (qvd)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;WHERE verb='CallStart'&amp;nbsp;&amp;nbsp; // or whatever the indicator is&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LEFT JOIN (Calls)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; call_id, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt; call_event_datetime as End_datetime&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;RESIDENT CDR.qvd (qvd)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;WHERE verb='CallEnd'&amp;nbsp;&amp;nbsp; // or whatever the indicator is&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LEFT JOIN (Calls)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt; call_id,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt; interval(End_datetime - Start_datetime, 'hh:mm:ss') as call_length&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;RESIDENT Calls&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Calls table now contains call_id, queue, agent, Start_datetime, EndDatetime, call_length&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://robwunderlich.com"&gt;http://robwunderlich.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 04:49:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregating-Call-Detail-Records-Per-Call-ID/m-p/246456#M496045</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2012-03-16T04:49:00Z</dc:date>
    </item>
  </channel>
</rss>

