<?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 condition in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-based-on-condition/m-p/1102823#M365579</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sinan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is what i am looking for but for some reason it does not count properly. If you look at Subsidiary A, we see 2 shipments with more than 2 customers but that is not true if you check the raw data. Subsidiary A should have 0 shipments with more than 2 customers (or equal).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Radu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Jul 2016 14:54:00 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-07-12T14:54:00Z</dc:date>
    <item>
      <title>Count based on condition</title>
      <link>https://community.qlik.com/t5/QlikView/Count-based-on-condition/m-p/1102818#M365574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;Hi guys,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;I have a database with Subsidiaries, Shipments and Customers. It is possible that 1 shipment goes to more than 1 customer (milk-run) and I would like to display that. Therefore, I want to count the number of shipments which have more (or equal to) than 2 customers for a subsidiary. In the end, I'd like to have a simple table in QlikView in the following format:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="font-size: 13.3333px;" width="243"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" width="71"&gt;Subsidiary&lt;/TD&gt;&lt;TD class="xl63" width="172"&gt;Shipments &amp;gt;= 2 Customers&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20"&gt;A&lt;/TD&gt;&lt;TD class="xl63"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20"&gt;B&lt;/TD&gt;&lt;TD class="xl63"&gt;8&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20"&gt;C&lt;/TD&gt;&lt;TD class="xl63"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Any ideas?&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jul 2016 15:04:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-based-on-condition/m-p/1102818#M365574</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-07-06T15:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Count based on condition</title>
      <link>https://community.qlik.com/t5/QlikView/Count-based-on-condition/m-p/1102819#M365575</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;Maybe something like this:&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14678209838758939 jive_text_macro" jivemacro_uid="_14678209838758939" modifiedtitle="true"&gt;
&lt;P&gt;Count({&amp;lt;Subsidiary={"Aggr(Count(Distinct Customers), Subsidiary)&amp;gt;=2"}&amp;gt;} Distinct Shipments)&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or you can post sample data which makes it easier to come up with a working syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jul 2016 16:06:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-based-on-condition/m-p/1102819#M365575</guid>
      <dc:creator>sinanozdemir</dc:creator>
      <dc:date>2016-07-06T16:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: Count based on condition</title>
      <link>https://community.qlik.com/t5/QlikView/Count-based-on-condition/m-p/1102820#M365576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would create a new field in the script which combines Subsidiary and Shipment field and use that in my set analysis condition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD Customers,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Subsidiaries,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Shipments,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AutoNumber(&lt;SPAN style="font-size: 13.3333px;"&gt;Subsidiaries&amp;amp;&lt;SPAN style="font-size: 13.3333px;"&gt;Shipments&lt;/SPAN&gt;, 'Key1') as Key&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;FROM Source....&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then try this expression:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Count(DISTINCT {&amp;lt;Key = {"=Count(DISTINCT Customers) &amp;gt; 1"}&amp;gt;}Shipments)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jul 2016 16:32:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-based-on-condition/m-p/1102820#M365576</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-07-06T16:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: Count based on condition</title>
      <link>https://community.qlik.com/t5/QlikView/Count-based-on-condition/m-p/1102821#M365577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sinan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached my database. Preferably, I would like to have the SUB as a Dimension in the Pivot Table and the count as an expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2016 07:52:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-based-on-condition/m-p/1102821#M365577</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-07-07T07:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: Count based on condition</title>
      <link>https://community.qlik.com/t5/QlikView/Count-based-on-condition/m-p/1102822#M365578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Radu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please the attached and let me know if this comes close to what you are looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2016 13:10:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-based-on-condition/m-p/1102822#M365578</guid>
      <dc:creator>sinanozdemir</dc:creator>
      <dc:date>2016-07-12T13:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: Count based on condition</title>
      <link>https://community.qlik.com/t5/QlikView/Count-based-on-condition/m-p/1102823#M365579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sinan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is what i am looking for but for some reason it does not count properly. If you look at Subsidiary A, we see 2 shipments with more than 2 customers but that is not true if you check the raw data. Subsidiary A should have 0 shipments with more than 2 customers (or equal).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Radu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2016 14:54:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-based-on-condition/m-p/1102823#M365579</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-07-12T14:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: Count based on condition</title>
      <link>https://community.qlik.com/t5/QlikView/Count-based-on-condition/m-p/1102824#M365580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let's see if this one is correct:&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/131019_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2016 15:27:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-based-on-condition/m-p/1102824#M365580</guid>
      <dc:creator>sinanozdemir</dc:creator>
      <dc:date>2016-07-12T15:27:32Z</dc:date>
    </item>
  </channel>
</rss>

