<?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 based on a condition where the condition is a calculation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-based-on-a-condition-where-the-condition-is-a-calculation/m-p/365150#M135881</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try it with DISTINCT spelled correctly&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Jun 2012 17:50:21 GMT</pubDate>
    <dc:creator>m_woolf</dc:creator>
    <dc:date>2012-06-25T17:50:21Z</dc:date>
    <item>
      <title>Count based on a condition where the condition is a calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Count-based-on-a-condition-where-the-condition-is-a-calculation/m-p/365147#M135878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to count the number of recently added companies to our db based on two conditions, where one condition is a calculation.&lt;/P&gt;&lt;P&gt;1) The first condition is the customer associated with the company must be a "new" customer. Hence, I created a field through scripting called NEW_CUSTOMER that designates customers added within the past 30 days. &lt;/P&gt;&lt;P&gt;2) The second condition, where I'm experiencing problems, is trying to identify companies where the count of companies =1, indicating the first instance of a given company in the db. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hence, the first condition identifies companies with brand new customers, and the second condition identifies companies where no other instance of a given company exists in the db. Together, they should produce a list of "new" companies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following expression as my starting point. The result tells me that the NEW_CUSTOMER portion of the expression is working, but the count of companies in the second condition is not working. Could anyone help with a solution please?&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count &lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;NEW_CUSTOMER&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={'New'} &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;AND&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Count&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;CONTACT_COMPANY&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)='1'&amp;gt;} distinct CONTACT_COMPANY) &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2012 21:05:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-based-on-a-condition-where-the-condition-is-a-calculation/m-p/365147#M135878</guid>
      <dc:creator />
      <dc:date>2012-06-22T21:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: Count based on a condition where the condition is a calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Count-based-on-a-condition-where-the-condition-is-a-calculation/m-p/365148#M135879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mattheb,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this one:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-size: 12px; font-family: Arial;"&gt;Count({$&amp;lt; &lt;/SPAN&gt;&lt;SPAN style="background-color: #eef4f9; font-size: 8pt; font-family: Arial; color: #800000;"&gt;NEW_CUSTOMER&lt;/SPAN&gt;&lt;SPAN style="background-color: #eef4f9; font-size: 8pt; color: #636363; font-family: Arial;"&gt;={'New'} ,&lt;SPAN style="color: #636363; font-family: Arial; font-size: 11px; background-color: #eef4f9;"&gt;CONTACT_COMPANY={"=&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="background-color: #eef4f9; font-size: 8pt; color: #636363; font-family: Arial;"&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 11px; background-color: #eef4f9;"&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px;"&gt;Count(DISTINC &lt;SPAN style="color: #800000; font-family: Arial; font-size: 11px; background-color: #eef4f9;"&gt;CONTACT_COMPANY&lt;/SPAN&gt;=1&lt;/SPAN&gt;"}&lt;/SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; color: #636363; font-family: Arial;"&gt;&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 11px; background-color: #eef4f9;"&gt;CONTACT_COMPANY&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; color: #636363; font-family: Arial;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #636363; font-family: Arial;"&gt;Hope i understend your needs,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #636363; font-family: Arial;"&gt;Regars,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #636363; font-family: Arial;"&gt;Yigal.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Jun 2012 07:23:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-based-on-a-condition-where-the-condition-is-a-calculation/m-p/365148#M135879</guid>
      <dc:creator />
      <dc:date>2012-06-23T07:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: Count based on a condition where the condition is a calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Count-based-on-a-condition-where-the-condition-is-a-calculation/m-p/365149#M135880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yigal, thanks for responding.&amp;nbsp; I tried your suggestion (shown below), but it generates an empty pivot table.&amp;nbsp; I've tried adding Contact_Company as a dimension, so I could at least see the list of companies, but no results appear.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial; color: #636363; font-size: 12px;"&gt;Count({$&amp;lt; &lt;/SPAN&gt;&lt;SPAN style="background-color: #eef4f9; font-family: Arial; color: #800000; font-size: 8pt;"&gt;NEW_CUSTOMER&lt;/SPAN&gt;&lt;SPAN style="background-color: #eef4f9; font-family: Arial; color: #636363; font-size: 8pt;"&gt;={'New'} ,&lt;SPAN style="background-color: #eef4f9; font-family: Arial; color: #636363; font-size: 11px;"&gt;CONTACT_COMPANY={"=&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="background-color: #eef4f9; font-family: Arial; color: #636363; font-size: 8pt;"&gt;&lt;SPAN style="background-color: #eef4f9; font-family: Arial; color: #636363; font-size: 11px;"&gt;&lt;SPAN style="font-family: Arial; color: #636363; font-size: 12px;"&gt;Count(DISTINC &lt;SPAN style="background-color: #eef4f9; font-family: Arial; color: #800000; font-size: 11px;"&gt;CONTACT_COMPANY&lt;/SPAN&gt;=1&lt;/SPAN&gt;"}&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: Arial; color: #636363; font-size: 12px;"&gt;&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="background-color: #eef4f9; font-family: Arial; color: #636363; font-size: 11px;"&gt;CONTACT_COMPANY&lt;/SPAN&gt;&lt;SPAN style="font-family: Arial; color: #636363; font-size: 12px;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2012 17:20:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-based-on-a-condition-where-the-condition-is-a-calculation/m-p/365149#M135880</guid>
      <dc:creator />
      <dc:date>2012-06-25T17:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: Count based on a condition where the condition is a calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Count-based-on-a-condition-where-the-condition-is-a-calculation/m-p/365150#M135881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try it with DISTINCT spelled correctly&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2012 17:50:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-based-on-a-condition-where-the-condition-is-a-calculation/m-p/365150#M135881</guid>
      <dc:creator>m_woolf</dc:creator>
      <dc:date>2012-06-25T17:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Count based on a condition where the condition is a calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Count-based-on-a-condition-where-the-condition-is-a-calculation/m-p/365151#M135882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did make the correction before trying, and I removed a few of the unnecessary spaces within the expression.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2012 18:03:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-based-on-a-condition-where-the-condition-is-a-calculation/m-p/365151#M135882</guid>
      <dc:creator />
      <dc:date>2012-06-25T18:03:22Z</dc:date>
    </item>
  </channel>
</rss>

