<?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 variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-function-in-variable/m-p/848761#M994223</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Reshma! Very useful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Jul 2015 10:28:53 GMT</pubDate>
    <dc:creator>infock12</dc:creator>
    <dc:date>2015-07-10T10:28:53Z</dc:date>
    <item>
      <title>Count function in variable</title>
      <link>https://community.qlik.com/t5/QlikView/Count-function-in-variable/m-p/848756#M994218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Happy Friday! Could someone please explain how can I use Count function in a variable. For example, I want to count the number of questions where Answer=Yes + Answer=No/Total Answer in percentage. Something like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vTotal=Count(Answer=Yes+No)/Count(Answers), #.##%&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried below in the load script but it may not have worked because with&lt;/P&gt;&lt;P&gt;SET vTotal=count({&amp;lt;Answer={'Yes', 'No'}&amp;gt; Answers}/count(Answer)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It didn't work...perhaps set analysis syntax cannot be used in load script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2015 08:53:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-function-in-variable/m-p/848756#M994218</guid>
      <dc:creator>infock12</dc:creator>
      <dc:date>2015-07-10T08:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: Count function in variable</title>
      <link>https://community.qlik.com/t5/QlikView/Count-function-in-variable/m-p/848757#M994219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's right, set analysis cannot be used in the script. But creating a variable with a set analysis expression will work fine. But make sure to use the exact case sensitive field names. Answers and Answer are two different field names. Perhaps you simply made a typo:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;SET vTotal=count({&amp;lt;Answer={'Yes', 'No'}&amp;gt; &lt;STRONG&gt;Answers&lt;/STRONG&gt;}/count(Answer) &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2015 08:55:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-function-in-variable/m-p/848757#M994219</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-07-10T08:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: Count function in variable</title>
      <link>https://community.qlik.com/t5/QlikView/Count-function-in-variable/m-p/848758#M994220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Take a look at my example&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2015 09:01:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-function-in-variable/m-p/848758#M994220</guid>
      <dc:creator>alexandros17</dc:creator>
      <dc:date>2015-07-10T09:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: Count function in variable</title>
      <link>https://community.qlik.com/t5/QlikView/Count-function-in-variable/m-p/848759#M994221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You can try this at script lever as &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;load count(if(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Answer&lt;/SPAN&gt;='YES'or &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Answer&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;='NO'&lt;/SPAN&gt;,1,0))/Count(Answer) as x&lt;/P&gt;&lt;P&gt;from xxx&lt;/P&gt;&lt;P&gt;group by &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Answer;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;vTotal=peek('&lt;SPAN style="font-size: 13.3333330154419px;"&gt;x',-1,'Table1'&lt;/SPAN&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2015 09:03:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-function-in-variable/m-p/848759#M994221</guid>
      <dc:creator />
      <dc:date>2015-07-10T09:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: Count function in variable</title>
      <link>https://community.qlik.com/t5/QlikView/Count-function-in-variable/m-p/848760#M994222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Gysbert! Yes, it is a typo.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2015 10:26:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-function-in-variable/m-p/848760#M994222</guid>
      <dc:creator>infock12</dc:creator>
      <dc:date>2015-07-10T10:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: Count function in variable</title>
      <link>https://community.qlik.com/t5/QlikView/Count-function-in-variable/m-p/848761#M994223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Reshma! Very useful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2015 10:28:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-function-in-variable/m-p/848761#M994223</guid>
      <dc:creator>infock12</dc:creator>
      <dc:date>2015-07-10T10:28:53Z</dc:date>
    </item>
  </channel>
</rss>

