<?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 values in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-values/m-p/456712#M484279</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for denominator&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count ({&amp;lt;Year 1= {1},contract year1 = {1}&amp;gt;}Contractyear1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count ({&amp;lt;Year2 = {1},contract year2 = {1}&amp;gt;}Contractyear2)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Jun 2013 14:22:03 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-06-10T14:22:03Z</dc:date>
    <item>
      <title>Count values</title>
      <link>https://community.qlik.com/t5/QlikView/Count-values/m-p/456710#M484277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a listbox (only to show data) that contains a field "contracts_in_year1" that looks like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Year1&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Value, frequency&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 506&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12440&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Year2&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Value, frequency&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1206&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10577&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So to be clear there are 506 contracts that does not match and 12440 that are matching.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I need to create a table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Year1|count of only the matching contracts (12440)&lt;/P&gt;&lt;P&gt;Year2|count of only the matching contracts (10577)&lt;/P&gt;&lt;P&gt;etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried the following to get only the valid contracts but it does not work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (Year=1, count({&amp;lt;[Contracts Year1]={1}&amp;gt;}[Contracts Year1]),if(Year=2,count({&amp;lt;[Contracts Year2]={2}&amp;gt;}[Contracts Year2], etc...))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any Idea why this is not working?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jun 2013 14:10:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-values/m-p/456710#M484277</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-06-10T14:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: Count values</title>
      <link>https://community.qlik.com/t5/QlikView/Count-values/m-p/456711#M484278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What do you mean with 'it does not work'? What do you get as result? And in what context are you using your expression?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Besides this, I think you need to use 1 as value for every field modifier: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (Year=1, count({&amp;lt;[Contracts Year1]={1}&amp;gt;}[Contracts Year1]),if(Year=2,count({&amp;lt;[Contracts Year2]={&lt;STRONG&gt;1&lt;/STRONG&gt;}&amp;gt;}[Contracts Year2], etc...))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or to simplify your expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pick(Year&lt;/P&gt;&lt;P&gt; ,count({&amp;lt;[Contracts Year1]={1}&amp;gt;}[Contracts Year1])&lt;/P&gt;&lt;P&gt; ,count({&amp;lt;[Contracts Year2]={1}&amp;gt;}[Contracts Year2])&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jun 2013 14:18:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-values/m-p/456711#M484278</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-06-10T14:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: Count values</title>
      <link>https://community.qlik.com/t5/QlikView/Count-values/m-p/456712#M484279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for denominator&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count ({&amp;lt;Year 1= {1},contract year1 = {1}&amp;gt;}Contractyear1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count ({&amp;lt;Year2 = {1},contract year2 = {1}&amp;gt;}Contractyear2)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jun 2013 14:22:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-values/m-p/456712#M484279</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-06-10T14:22:03Z</dc:date>
    </item>
  </channel>
</rss>

