<?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 Counting Occurrences of a String in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Counting-Occurrences-of-a-String/m-p/326745#M1195491</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; It may depend on your data model. If you select LOC_STAT = 'Empty' on a list box, do you get the right results?&lt;/P&gt;&lt;P&gt;You can also try to make it with set analysis&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Count( {&amp;lt; LOC_STAT={Empty} [Site_Details LOC_CODE)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it doesn`t work, can you share some sample app or data so we can try to reproduce it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 May 2011 13:13:07 GMT</pubDate>
    <dc:creator>erichshiino</dc:creator>
    <dc:date>2011-05-25T13:13:07Z</dc:date>
    <item>
      <title>Counting Occurrences of a String</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-Occurrences-of-a-String/m-p/326744#M1195489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I count an occurrence of a string?&amp;nbsp; I thought it would be straightforward, but I must be missing something?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To count the total number of locations in a warehouse I have used Count([Site_Details LOC_CODE]) which works just fine.&amp;nbsp; But to count the number of empty locations, I have used Count(If(LOC_STAT='Empty',[Site_Details LOC_CODE)).&amp;nbsp; But surprisingly, I get the same count as for the total number of locations?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Ian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 May 2011 12:53:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-Occurrences-of-a-String/m-p/326744#M1195489</guid>
      <dc:creator />
      <dc:date>2011-05-25T12:53:51Z</dc:date>
    </item>
    <item>
      <title>Counting Occurrences of a String</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-Occurrences-of-a-String/m-p/326745#M1195491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; It may depend on your data model. If you select LOC_STAT = 'Empty' on a list box, do you get the right results?&lt;/P&gt;&lt;P&gt;You can also try to make it with set analysis&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Count( {&amp;lt; LOC_STAT={Empty} [Site_Details LOC_CODE)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it doesn`t work, can you share some sample app or data so we can try to reproduce it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 May 2011 13:13:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-Occurrences-of-a-String/m-p/326745#M1195491</guid>
      <dc:creator>erichshiino</dc:creator>
      <dc:date>2011-05-25T13:13:07Z</dc:date>
    </item>
    <item>
      <title>Counting Occurrences of a String</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-Occurrences-of-a-String/m-p/326746#M1195493</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;syntaxically it looks ok but your data model will impact how counts are done in many ways. Simplest way to test what is happening is make two listboxes, one with LOC_STAT the other with LOC_CODE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What can you see in these listboxes? If you select the value "Empty" in the LOC_STAT box does the LOC_CODE listbox change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Going a bit further create a chart with a single dimension being your LOC_CODE. Add two expressions, the first being simply "1" with totals = sum, this will give you a count of all distinct LOC_CODEs, the second being =count(LOC_CODE) again with totals=sum, this will give you a count of total records by LOC_CODE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again select values on your LOC_STAT listbox and see what happens here.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 May 2011 13:15:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-Occurrences-of-a-String/m-p/326746#M1195493</guid>
      <dc:creator>pat_agen</dc:creator>
      <dc:date>2011-05-25T13:15:51Z</dc:date>
    </item>
  </channel>
</rss>

