<?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: Re: Countif based on another field in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Countif-based-on-another-field/m-p/659279#M1085071</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Amazing! Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I didn't realize that breaking the connection between variables would do the trick. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Jun 2014 14:54:43 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-06-11T14:54:43Z</dc:date>
    <item>
      <title>Countif based on another field</title>
      <link>https://community.qlik.com/t5/QlikView/Countif-based-on-another-field/m-p/659275#M1085064</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 have data similarly structured to one below. It has IDN (e.g. time stamp) and sets of persons. Same persons appear in both sets but Set1 is assumed to be the complete list of persons. I have table where &lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Set1 is only dimension&lt;/LI&gt;&lt;LI&gt;for first column expression is =Count(DISTINCT IDN). &lt;/LI&gt;&lt;LI&gt;for second column I would like to have something similar as Excel's countif function =countif(column for Set2 in data,set1 value in result table). For first row (Set1 value is&amp;nbsp; A) it should thous count how many times A appears in Set2.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result table:&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="150" style="border: 1px solid rgb(0, 0, 0); width: 237px; height: 77px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Set1&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Count set1&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Count set2&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;C&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;D&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 168px;"&gt;&lt;TBODY&gt;&lt;TR style="height: 12.75pt;"&gt;&lt;TD class="xl65" height="17" style="height: 12.75pt; width: 42pt;" width="56"&gt;&lt;P&gt;IDN&lt;/P&gt;&lt;/TD&gt;&lt;TD class="xl65" style="width: 42pt;" width="56"&gt;Set1&lt;/TD&gt;&lt;TD class="xl65" style="width: 42pt;" width="56"&gt;Set2&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 12.75pt;"&gt;&lt;TD class="xl66" height="17" style="height: 12.75pt;"&gt;1&lt;/TD&gt;&lt;TD class="xl66"&gt;A&lt;/TD&gt;&lt;TD class="xl66"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 12.75pt;"&gt;&lt;TD class="xl66" height="17" style="height: 12.75pt;"&gt;2&lt;/TD&gt;&lt;TD class="xl66"&gt;A&lt;/TD&gt;&lt;TD class="xl66"&gt;C&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 12.75pt;"&gt;&lt;TD class="xl66" height="17" style="height: 12.75pt;"&gt;3&lt;/TD&gt;&lt;TD class="xl66"&gt;A&lt;/TD&gt;&lt;TD class="xl66"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 12.75pt;"&gt;&lt;TD class="xl66" height="17" style="height: 12.75pt;"&gt;3&lt;/TD&gt;&lt;TD class="xl66"&gt;A&lt;/TD&gt;&lt;TD class="xl68"&gt;B&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 12.75pt;"&gt;&lt;TD class="xl66" height="17" style="height: 12.75pt;"&gt;4&lt;/TD&gt;&lt;TD class="xl68"&gt;B&lt;/TD&gt;&lt;TD class="xl66"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 12.75pt;"&gt;&lt;TD class="xl66" height="17" style="height: 12.75pt;"&gt;5&lt;/TD&gt;&lt;TD class="xl68"&gt;B&lt;/TD&gt;&lt;TD class="xl66"&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 12.75pt;"&gt;&lt;TD class="xl66" height="17" style="height: 12.75pt;"&gt;6&lt;/TD&gt;&lt;TD class="xl68"&gt;B&lt;/TD&gt;&lt;TD class="xl66"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 12.75pt;"&gt;&lt;TD class="xl66" height="17" style="height: 12.75pt;"&gt;7&lt;/TD&gt;&lt;TD class="xl68"&gt;B&lt;/TD&gt;&lt;TD class="xl66"&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 12.75pt;"&gt;&lt;TD class="xl66" height="17" style="height: 12.75pt;"&gt;7&lt;/TD&gt;&lt;TD class="xl68"&gt;B&lt;/TD&gt;&lt;TD class="xl66"&gt;C&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 12.75pt;"&gt;&lt;TD class="xl66" height="17" style="height: 12.75pt;"&gt;7&lt;/TD&gt;&lt;TD class="xl68"&gt;B&lt;/TD&gt;&lt;TD class="xl66"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 12.75pt;"&gt;&lt;TD class="xl67" height="17" style="height: 12.75pt;"&gt;8&lt;/TD&gt;&lt;TD class="xl66"&gt;C&lt;/TD&gt;&lt;TD class="xl66"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 12.75pt;"&gt;&lt;TD class="xl67" height="17" style="height: 12.75pt;"&gt;9&lt;/TD&gt;&lt;TD class="xl66"&gt;C&lt;/TD&gt;&lt;TD class="xl66"&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 12.75pt;"&gt;&lt;TD class="xl66" height="17" style="height: 12.75pt;"&gt;9&lt;/TD&gt;&lt;TD class="xl66"&gt;C&lt;/TD&gt;&lt;TD class="xl68"&gt;B&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 12.75pt;"&gt;&lt;TD class="xl66" height="17" style="height: 12.75pt;"&gt;10&lt;/TD&gt;&lt;TD class="xl66"&gt;D&lt;/TD&gt;&lt;TD class="xl66"&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 12.75pt;"&gt;&lt;TD class="xl66" height="17" style="height: 12.75pt;"&gt;10&lt;/TD&gt;&lt;TD class="xl66"&gt;D&lt;/TD&gt;&lt;TD class="xl66"&gt;C&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2014 13:26:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Countif-based-on-another-field/m-p/659275#M1085064</guid>
      <dc:creator />
      <dc:date>2014-06-11T13:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: Countif based on another field</title>
      <link>https://community.qlik.com/t5/QlikView/Countif-based-on-another-field/m-p/659276#M1085065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See attached qvw&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2014 13:36:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Countif-based-on-another-field/m-p/659276#M1085065</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-06-11T13:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: Countif based on another field</title>
      <link>https://community.qlik.com/t5/QlikView/Countif-based-on-another-field/m-p/659277#M1085067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, your solution is an answer to my original question. I should have mentioned that the data was only an example structured similarly as my real data that has approx 400 different values corresponding A,B,C,D.... Thus hard coding each of them is not what I want to do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pick(match(Set1,'A','B','C','D')&lt;/P&gt;&lt;P&gt;,count({&amp;lt;Set2={'A'}&amp;gt;} total IDN)&lt;/P&gt;&lt;P&gt;,count({&amp;lt;Set2={'B'}&amp;gt;} total IDN)&lt;/P&gt;&lt;P&gt;,count({&amp;lt;Set2={'C'}&amp;gt;} total IDN)&lt;/P&gt;&lt;P&gt;,count({&amp;lt;Set2={'D'}&amp;gt;} total IDN)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2014 13:42:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Countif-based-on-another-field/m-p/659277#M1085067</guid>
      <dc:creator />
      <dc:date>2014-06-11T13:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Countif based on another field</title>
      <link>https://community.qlik.com/t5/QlikView/Countif-based-on-another-field/m-p/659278#M1085069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've added a second option. See attached qvw.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2014 13:57:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Countif-based-on-another-field/m-p/659278#M1085069</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-06-11T13:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Countif based on another field</title>
      <link>https://community.qlik.com/t5/QlikView/Countif-based-on-another-field/m-p/659279#M1085071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Amazing! Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I didn't realize that breaking the connection between variables would do the trick. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2014 14:54:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Countif-based-on-another-field/m-p/659279#M1085071</guid>
      <dc:creator />
      <dc:date>2014-06-11T14:54:43Z</dc:date>
    </item>
  </channel>
</rss>

