<?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 count how often two values ​​occur in one column in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/count-how-often-two-values-occur-in-one-column/m-p/2064233#M1223380</link>
    <description>&lt;P&gt;Hi there,&lt;BR /&gt;I want to count how often it happens that a column contains two specified values ​​per id&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;ID | KEY&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp;| A&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp;| A&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp;| B&lt;/P&gt;
&lt;P&gt;3&amp;nbsp; &amp;nbsp;| B&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result should be a formula to count&amp;nbsp; the ID's where KEY = A and KEY = B, for that example it should return 1, because it only happens for one ID that KEY is set to A and B.&lt;/P&gt;</description>
    <pubDate>Tue, 25 Apr 2023 13:10:01 GMT</pubDate>
    <dc:creator>markuskoessler</dc:creator>
    <dc:date>2023-04-25T13:10:01Z</dc:date>
    <item>
      <title>count how often two values ​​occur in one column</title>
      <link>https://community.qlik.com/t5/QlikView/count-how-often-two-values-occur-in-one-column/m-p/2064233#M1223380</link>
      <description>&lt;P&gt;Hi there,&lt;BR /&gt;I want to count how often it happens that a column contains two specified values ​​per id&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;ID | KEY&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp;| A&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp;| A&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp;| B&lt;/P&gt;
&lt;P&gt;3&amp;nbsp; &amp;nbsp;| B&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result should be a formula to count&amp;nbsp; the ID's where KEY = A and KEY = B, for that example it should return 1, because it only happens for one ID that KEY is set to A and B.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2023 13:10:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-how-often-two-values-occur-in-one-column/m-p/2064233#M1223380</guid>
      <dc:creator>markuskoessler</dc:creator>
      <dc:date>2023-04-25T13:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: count how often two values ​​occur in one column</title>
      <link>https://community.qlik.com/t5/QlikView/count-how-often-two-values-occur-in-one-column/m-p/2064260#M1223381</link>
      <description>&lt;P&gt;Try using Peek (can use previous() too over here) function to check previous row value in the load script.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data:&lt;BR /&gt;load *,&lt;BR /&gt;if(RowNo() &amp;lt;&amp;gt; 1 &lt;BR /&gt;, if(ID = peek(ID) and KEY &amp;lt;&amp;gt; peek(KEY), 1, 0)&lt;BR /&gt;, 0) as counter;&lt;BR /&gt;load * inline [&lt;BR /&gt;ID, KEY&lt;BR /&gt;1, A&lt;BR /&gt;2, A&lt;BR /&gt;2, B&lt;BR /&gt;3, B ];&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snip.PNG" style="width: 504px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/105769i0B20E53C4DBE2161/image-size/large?v=v2&amp;amp;px=999" role="button" title="Snip.PNG" alt="Snip.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2023 13:56:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-how-often-two-values-occur-in-one-column/m-p/2064260#M1223381</guid>
      <dc:creator>Qrishna</dc:creator>
      <dc:date>2023-04-25T13:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: count how often two values ​​occur in one column</title>
      <link>https://community.qlik.com/t5/QlikView/count-how-often-two-values-occur-in-one-column/m-p/2064275#M1223382</link>
      <description>&lt;P&gt;Thanks, but is there any way to do it within the workbook?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2023 13:53:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-how-often-two-values-occur-in-one-column/m-p/2064275#M1223382</guid>
      <dc:creator>markuskoessler</dc:creator>
      <dc:date>2023-04-25T13:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: count how often two values ​​occur in one column</title>
      <link>https://community.qlik.com/t5/QlikView/count-how-often-two-values-occur-in-one-column/m-p/2064276#M1223383</link>
      <description>&lt;P&gt;i have attached the qvw to the above response.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2023 13:57:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-how-often-two-values-occur-in-one-column/m-p/2064276#M1223383</guid>
      <dc:creator>Qrishna</dc:creator>
      <dc:date>2023-04-25T13:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: count how often two values ​​occur in one column</title>
      <link>https://community.qlik.com/t5/QlikView/count-how-often-two-values-occur-in-one-column/m-p/2064570#M1223392</link>
      <description>&lt;P&gt;Thanks for your response,&lt;/P&gt;
&lt;P&gt;I've found a solution for this which works for me.&lt;/P&gt;
&lt;P&gt;I've changed my table (actually it's a database view), now it looks like that:&lt;/P&gt;
&lt;P&gt;ID | KEY | KEY_AGG&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp;| A&amp;nbsp; &amp;nbsp; &amp;nbsp; | A&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp;| A&amp;nbsp; &amp;nbsp; &amp;nbsp; | A,B&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp;| B&amp;nbsp; &amp;nbsp; &amp;nbsp; | A,B&lt;/P&gt;
&lt;P&gt;3&amp;nbsp; &amp;nbsp;| B&amp;nbsp; &amp;nbsp; &amp;nbsp; | B&lt;/P&gt;
&lt;P&gt;And now I do something like that&lt;/P&gt;
&lt;P&gt;count(distinct{&amp;lt;KEYAGG={"A"},KEYAGG={"B"}&amp;gt;}ID)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 06:31:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-how-often-two-values-occur-in-one-column/m-p/2064570#M1223392</guid>
      <dc:creator>markuskoessler</dc:creator>
      <dc:date>2023-04-26T06:31:16Z</dc:date>
    </item>
  </channel>
</rss>

