<?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 Re: Count occurrences based on value in separate field in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-occurrences-based-on-value-in-separate-field/m-p/1695460#M726908</link>
    <description>&lt;P&gt;Was it someting like this you where expecting?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Vegar_0-1587506685825.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/32222i13739B5A2277F0FD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vegar_0-1587506685825.png" alt="Vegar_0-1587506685825.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The expression for ID dimension is as follows:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;=aggr(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp; &amp;nbsp;if(COUNT({&amp;lt;ID,SALES={[&amp;gt;60]},SALESDATE={[&amp;lt;$(=max(SALESDATE))&amp;gt;=&amp;lt;$(=addmonths(max(SALESDATE),-1))]}&amp;gt;}SALES)&amp;gt;4, &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp; &amp;nbsp;only({1}ID),&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp; &amp;nbsp;NULL()&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp; )&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier" size="2"&gt;,ID)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Apr 2020 22:07:10 GMT</pubDate>
    <dc:creator>Vegar</dc:creator>
    <dc:date>2020-04-21T22:07:10Z</dc:date>
    <item>
      <title>Count occurrences based on value in separate field</title>
      <link>https://community.qlik.com/t5/QlikView/Count-occurrences-based-on-value-in-separate-field/m-p/1686577#M726905</link>
      <description>&lt;P&gt;hello i am trying create an expression that counts the number of times&amp;nbsp; an a field has more than 2 occurrences of a specified value of another field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for example i have data that looks something like this.&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" width="192" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="64" height="20"&gt;ID&lt;/TD&gt;&lt;TD width="64"&gt;Mon/Year&lt;/TD&gt;&lt;TD width="64"&gt;Sales&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;A&lt;/TD&gt;&lt;TD&gt;Mar-19&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;A&lt;/TD&gt;&lt;TD&gt;Mar-19&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;B&lt;/TD&gt;&lt;TD&gt;Mar-19&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;B&lt;/TD&gt;&lt;TD&gt;Mar-19&lt;/TD&gt;&lt;TD&gt;60&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;C&lt;/TD&gt;&lt;TD&gt;Mar-19&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;C&lt;/TD&gt;&lt;TD&gt;Mar-19&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;A&lt;/TD&gt;&lt;TD&gt;Apr-19&lt;/TD&gt;&lt;TD&gt;60&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;A&lt;/TD&gt;&lt;TD&gt;Apr-19&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;A&lt;/TD&gt;&lt;TD&gt;Apr-19&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;B&lt;/TD&gt;&lt;TD&gt;Apr-19&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;B&lt;/TD&gt;&lt;TD&gt;Apr-19&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;C&lt;/TD&gt;&lt;TD&gt;Apr-19&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;C&lt;/TD&gt;&lt;TD&gt;Apr-19&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what i want is an expression that calculates the&amp;nbsp; number of id's that had more than 2 instances of sales greater than 50 in a Mon/Year.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;something like the following.&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" width="128" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="64" height="20"&gt;Mon/Year&lt;/TD&gt;&lt;TD width="64"&gt;Number of ID's with greater than count of 2 sales &amp;gt; =50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Mar-19&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Apr-19&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-occurrences-based-on-value-in-separate-field/m-p/1686577#M726905</guid>
      <dc:creator>nlaughton</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Count occurrences based on value in separate field</title>
      <link>https://community.qlik.com/t5/QlikView/Count-occurrences-based-on-value-in-separate-field/m-p/1686616#M726906</link>
      <description>&lt;P&gt;I used this expression:&lt;/P&gt;&lt;P&gt;&amp;nbsp;c&lt;FONT face="courier new,courier"&gt;ount({&amp;lt; TypeID = {"=count({&amp;lt;Sales = {[&amp;gt;=50]}&amp;gt;} ID)&amp;gt;1"}&amp;gt;} distinct ID)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;On top of this script:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Load AutoNumberHash128(ID, [Mon/Year]) as TypeID, * inline[&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;ID,Mon/Year,Sales&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;A,Mar-19,50&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;A,Mar-19,50&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;B,Mar-19,50&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;B,Mar-19,60&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;C,Mar-19,50&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;C,Mar-19,50&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;A,Apr-19,60&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;A,Apr-19,50&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;A,Apr-19,50&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;B,Apr-19,40&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;B,Apr-19,20&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;C,Apr-19,20&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;C,Apr-19,50&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;];&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;I get this output:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 371px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/30364i2B9BF3CBB1483C19/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Mar 2020 00:01:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-occurrences-based-on-value-in-separate-field/m-p/1686616#M726906</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2020-03-21T00:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: Count occurrences based on value in separate field</title>
      <link>https://community.qlik.com/t5/QlikView/Count-occurrences-based-on-value-in-separate-field/m-p/1695021#M726907</link>
      <description>&lt;P&gt;I'M still struggling with this is there a way to do this with out adding the extra hash field and only doing it through the chart and the expression.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the real data behind this is complicated and i'd like to not try and change the load script.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;as an example see the attached. what i would like to find is the distinct id's that have greater than 60 in sales on more than 4 days in any one month.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 19:14:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-occurrences-based-on-value-in-separate-field/m-p/1695021#M726907</guid>
      <dc:creator>nlaughton</dc:creator>
      <dc:date>2020-04-20T19:14:42Z</dc:date>
    </item>
    <item>
      <title>Re: Count occurrences based on value in separate field</title>
      <link>https://community.qlik.com/t5/QlikView/Count-occurrences-based-on-value-in-separate-field/m-p/1695460#M726908</link>
      <description>&lt;P&gt;Was it someting like this you where expecting?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Vegar_0-1587506685825.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/32222i13739B5A2277F0FD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vegar_0-1587506685825.png" alt="Vegar_0-1587506685825.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The expression for ID dimension is as follows:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;=aggr(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp; &amp;nbsp;if(COUNT({&amp;lt;ID,SALES={[&amp;gt;60]},SALESDATE={[&amp;lt;$(=max(SALESDATE))&amp;gt;=&amp;lt;$(=addmonths(max(SALESDATE),-1))]}&amp;gt;}SALES)&amp;gt;4, &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp; &amp;nbsp;only({1}ID),&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp; &amp;nbsp;NULL()&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp; )&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier" size="2"&gt;,ID)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2020 22:07:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-occurrences-based-on-value-in-separate-field/m-p/1695460#M726908</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2020-04-21T22:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: Count occurrences based on value in separate field</title>
      <link>https://community.qlik.com/t5/QlikView/Count-occurrences-based-on-value-in-separate-field/m-p/1695787#M726909</link>
      <description>&lt;P&gt;is there a way i could turn that expression your wrote into a count, so that i would know how many Id's that equals?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2020 14:57:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-occurrences-based-on-value-in-separate-field/m-p/1695787#M726909</guid>
      <dc:creator>nlaughton</dc:creator>
      <dc:date>2020-04-22T14:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: Count occurrences based on value in separate field</title>
      <link>https://community.qlik.com/t5/QlikView/Count-occurrences-based-on-value-in-separate-field/m-p/1695897#M726910</link>
      <description>&lt;P&gt;You could try this expression:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;=&lt;FONT color="#0000FF"&gt;count&lt;/FONT&gt;(&lt;FONT color="#0000FF"&gt;aggr&lt;/FONT&gt;(&lt;FONT color="#0000FF"&gt;only&lt;/FONT&gt;({&lt;FONT color="#993300"&gt;&amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier" color="#993300"&gt;ID &lt;FONT color="#000000"&gt;= {&lt;/FONT&gt;"=COUNT({&amp;lt;ID, SALES={[&amp;gt;60]} ,SALESDATE = {[&amp;lt;$(=max(SALESDATE))&amp;gt;=&amp;lt;$(=addmonths(max(SALESDATE),-1))]}&amp;gt;}SALES)&amp;gt;4"&lt;FONT color="#000000"&gt;}&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&lt;FONT color="#993300"&gt;&amp;gt;&lt;/FONT&gt;}&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&lt;FONT color="#993300"&gt;ID&lt;/FONT&gt;),&lt;FONT color="#993300"&gt;ID&lt;/FONT&gt;))&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2020 19:41:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-occurrences-based-on-value-in-separate-field/m-p/1695897#M726910</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2020-04-22T19:41:22Z</dc:date>
    </item>
  </channel>
</rss>

