<?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 Event count by first sub-event dimension value? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Event-count-by-first-sub-event-dimension-value/m-p/907209#M987161</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, this problem has frustrated two of us for most of a day so I'm hoping someone can help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our data consists of sub-event records that are grouped into events via an EventID.&amp;nbsp; Each sub-event has a StaffID field and a TimeStamp field (among others).&amp;nbsp; What we want to do is to produce a table chart showing the number of times each StaffID appears as the first person involved in an event.&amp;nbsp; Or, to put it another way, the number of events that were first handled by each person.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We tried creating a straight table with a single dimension StaffID and the&amp;nbsp; single expression below:&lt;/P&gt;&lt;P&gt;Count(Aggr(FirstSortedValue(StaffID,TimeStamp), EventID))&lt;/P&gt;&lt;P&gt;The thinking being that the Aggr() would create an intermediate table containing the first StaffID against each EventID and then the Count would aggregate over the chart dimensions, ie StaffID.&amp;nbsp; The result being the count of the number of times each StaffID appeared against an EventID as the first one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately it doesn't work and the results seem unpredictable.&amp;nbsp; Can anyone help us understand why and/or suggest a modification or alterative approach?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Robin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Jul 2015 08:28:16 GMT</pubDate>
    <dc:creator>robinrouleur</dc:creator>
    <dc:date>2015-07-21T08:28:16Z</dc:date>
    <item>
      <title>Event count by first sub-event dimension value?</title>
      <link>https://community.qlik.com/t5/QlikView/Event-count-by-first-sub-event-dimension-value/m-p/907209#M987161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, this problem has frustrated two of us for most of a day so I'm hoping someone can help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our data consists of sub-event records that are grouped into events via an EventID.&amp;nbsp; Each sub-event has a StaffID field and a TimeStamp field (among others).&amp;nbsp; What we want to do is to produce a table chart showing the number of times each StaffID appears as the first person involved in an event.&amp;nbsp; Or, to put it another way, the number of events that were first handled by each person.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We tried creating a straight table with a single dimension StaffID and the&amp;nbsp; single expression below:&lt;/P&gt;&lt;P&gt;Count(Aggr(FirstSortedValue(StaffID,TimeStamp), EventID))&lt;/P&gt;&lt;P&gt;The thinking being that the Aggr() would create an intermediate table containing the first StaffID against each EventID and then the Count would aggregate over the chart dimensions, ie StaffID.&amp;nbsp; The result being the count of the number of times each StaffID appeared against an EventID as the first one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately it doesn't work and the results seem unpredictable.&amp;nbsp; Can anyone help us understand why and/or suggest a modification or alterative approach?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Robin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2015 08:28:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Event-count-by-first-sub-event-dimension-value/m-p/907209#M987161</guid>
      <dc:creator>robinrouleur</dc:creator>
      <dc:date>2015-07-21T08:28:16Z</dc:date>
    </item>
    <item>
      <title>Re: Event count by first sub-event dimension value?</title>
      <link>https://community.qlik.com/t5/QlikView/Event-count-by-first-sub-event-dimension-value/m-p/907210#M987162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it would be easier to troubleshoot if you upload a simple example application&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2015 08:36:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Event-count-by-first-sub-event-dimension-value/m-p/907210#M987162</guid>
      <dc:creator />
      <dc:date>2015-07-21T08:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: Event count by first sub-event dimension value?</title>
      <link>https://community.qlik.com/t5/QlikView/Event-count-by-first-sub-event-dimension-value/m-p/907211#M987163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal,monaco;"&gt;Count(If(StaffID= Aggr(FirstSortedValue(StaffID,TimeStamp), EventID),1))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2015 09:01:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Event-count-by-first-sub-event-dimension-value/m-p/907211#M987163</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2015-07-21T09:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: Event count by first sub-event dimension value?</title>
      <link>https://community.qlik.com/t5/QlikView/Event-count-by-first-sub-event-dimension-value/m-p/907212#M987164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Tresesco, yes that seems to work though I replaced your Count with Sum.&amp;nbsp; My main problem turned out to be that I had to duplicate some set analysis that I had in the the FirstSortedValue expression into the Count/Sum expresssion (I left this out of my problem description for simplicity).&amp;nbsp; Once I had done that both my original expression and your suggestion gave similar results, though not quite the same.&amp;nbsp; Closer inspection showed yours to be correct.&amp;nbsp; Why they differ is still a puzzle to me, though I suspect it is due to some "under the bonnet" behaviour that I have not grasped yet.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2015 02:39:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Event-count-by-first-sub-event-dimension-value/m-p/907212#M987164</guid>
      <dc:creator>robinrouleur</dc:creator>
      <dc:date>2015-08-04T02:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: Event count by first sub-event dimension value?</title>
      <link>https://community.qlik.com/t5/QlikView/Event-count-by-first-sub-event-dimension-value/m-p/907213#M987165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It turns out that my approach was wrong.&amp;nbsp; What I wanted to achieve cannot be done this way as the scope of the Aggr cannot be broader than that of the outer aggregation function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The solution is to use a calculated dimension:&lt;/P&gt;&lt;P&gt;Aggr(FirstSortedValue(StaffID,TimeStamp), EventID))&lt;/P&gt;&lt;P&gt;with an expression:&lt;/P&gt;&lt;P&gt;Count(DISTINCT EventID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is some useful discussion on this in the standard QlikView Help under:&lt;/P&gt;&lt;P&gt;"Nested Aggregations and Related Issues"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2015 01:21:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Event-count-by-first-sub-event-dimension-value/m-p/907213#M987165</guid>
      <dc:creator>robinrouleur</dc:creator>
      <dc:date>2015-08-12T01:21:07Z</dc:date>
    </item>
  </channel>
</rss>

