<?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 function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-function/m-p/1070084#M357485</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;=sum(agg(Count(&lt;/P&gt;&lt;P&gt;if (v1&amp;gt;v2,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;DISTINCT&lt;/SPAN&gt;[Item Number]))))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Feb 2016 10:09:58 GMT</pubDate>
    <dc:creator>Chanty4u</dc:creator>
    <dc:date>2016-02-19T10:09:58Z</dc:date>
    <item>
      <title>Count function</title>
      <link>https://community.qlik.com/t5/QlikView/Count-function/m-p/1070083#M357484</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 am trying to count the number of items that are doing better compared to the previous year. I have two variables set up as follows which shows the total sales for the respective years:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v1)=num(sum(AGGR(SUM({&amp;lt;FiscalYear={2016}&amp;gt;}SLL_PriceExc),[Item Number])),'#.')&lt;/P&gt;&lt;P&gt;v2)= num(sum(AGGR(SUM({&amp;lt;FiscalYear={2015}&amp;gt;}SLL_PriceExc),[Item Number])),'#.')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to use the following formula but it did not give any results:&lt;/P&gt;&lt;P&gt;=num(Count(DISTINCT( if (v1&amp;gt;v2,[Item Number]))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Shamit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2016 00:56:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-function/m-p/1070083#M357484</guid>
      <dc:creator>shamitshah</dc:creator>
      <dc:date>2016-02-19T00:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: Count function</title>
      <link>https://community.qlik.com/t5/QlikView/Count-function/m-p/1070084#M357485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;=sum(agg(Count(&lt;/P&gt;&lt;P&gt;if (v1&amp;gt;v2,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;DISTINCT&lt;/SPAN&gt;[Item Number]))))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2016 10:09:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-function/m-p/1070084#M357485</guid>
      <dc:creator>Chanty4u</dc:creator>
      <dc:date>2016-02-19T10:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: Count function</title>
      <link>https://community.qlik.com/t5/QlikView/Count-function/m-p/1070085#M357486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you change your variable to this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;v1 = Aggr(Sum({&amp;lt;FiscalYear={2016}&amp;gt;}SLL_PriceExc),[Item Number])&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;v2 = Aggr(Sum({&amp;lt;FiscalYear={2015}&amp;gt;}SLL_PriceExc),[Item Number])&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;and then try this:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;Count(DISTINCT(If(v1 &amp;gt; v2, [Item Number]))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Have not tested it out, so not 100% sure if this is going to work or not&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2016 10:10:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-function/m-p/1070085#M357486</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-02-19T10:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: Count function</title>
      <link>https://community.qlik.com/t5/QlikView/Count-function/m-p/1070086#M357487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;=num(Count(DISTINCT( if (v1&amp;gt;v2,[Item Number]))),'#.')&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2016 10:12:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-function/m-p/1070086#M357487</guid>
      <dc:creator>Chanty4u</dc:creator>
      <dc:date>2016-02-19T10:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: Count function</title>
      <link>https://community.qlik.com/t5/QlikView/Count-function/m-p/1070087#M357488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny &amp;amp; Chanty&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried what you mentioned above, but is does not seem to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Shamit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2016 14:10:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-function/m-p/1070087#M357488</guid>
      <dc:creator>shamitshah</dc:creator>
      <dc:date>2016-02-19T14:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: Count function</title>
      <link>https://community.qlik.com/t5/QlikView/Count-function/m-p/1070088#M357489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;post your application with sample data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Sathish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2016 14:18:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-function/m-p/1070088#M357489</guid>
      <dc:creator>sathishkumar_go</dc:creator>
      <dc:date>2016-02-19T14:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: Count function</title>
      <link>https://community.qlik.com/t5/QlikView/Count-function/m-p/1070089#M357490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you share a sample?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2016 14:29:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-function/m-p/1070089#M357490</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-02-19T14:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: Count function</title>
      <link>https://community.qlik.com/t5/QlikView/Count-function/m-p/1070090#M357491</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;Please see attached file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The number of items with a positive variance in the text box should be 1 instead of 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Shamit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Feb 2016 01:57:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-function/m-p/1070090#M357491</guid>
      <dc:creator>shamitshah</dc:creator>
      <dc:date>2016-02-20T01:57:48Z</dc:date>
    </item>
    <item>
      <title>Re: Count function</title>
      <link>https://community.qlik.com/t5/QlikView/Count-function/m-p/1070091#M357492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try =Count({&amp;lt;Item={"=sum({&amp;lt;Year={2016}&amp;gt;}Sales)&amp;gt;sum({&amp;lt;Year={2015}&amp;gt;}Sales)"}&amp;gt;}DISTINCT Item)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Feb 2016 10:42:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-function/m-p/1070091#M357492</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-02-20T10:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: Count function</title>
      <link>https://community.qlik.com/t5/QlikView/Count-function/m-p/1070092#M357493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can apply Gysbert's logic with variables also:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Count({&amp;lt;Item={"=$(v1)&amp;gt;$(v2)"}&amp;gt;}DISTINCT Item)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where &lt;STRONG&gt;v1&lt;/STRONG&gt; is defined as '&lt;STRONG&gt;Sum({&amp;lt;Year={2016}&amp;gt;}Sales)&lt;/STRONG&gt;' and &lt;STRONG&gt;v2&lt;/STRONG&gt; is defined as '&lt;STRONG&gt;Sum({&amp;lt;Year={2015}&amp;gt;}Sales)&lt;/STRONG&gt;'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/115318_Capture.PNG" style="height: 147px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Feb 2016 12:57:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-function/m-p/1070092#M357493</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-02-20T12:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: Count function</title>
      <link>https://community.qlik.com/t5/QlikView/Count-function/m-p/1070093#M357494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks you Gysbert and Sunny. Both correct answers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Awesome!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shamit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Feb 2016 14:43:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-function/m-p/1070093#M357494</guid>
      <dc:creator>shamitshah</dc:creator>
      <dc:date>2016-02-20T14:43:18Z</dc:date>
    </item>
  </channel>
</rss>

