<?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: complex Count statement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/complex-Count-statement/m-p/748147#M266951</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try like:&lt;/P&gt;&lt;P&gt;count({&amp;lt;&lt;STRONG&gt;customer_ID&lt;/STRONG&gt;={"=&lt;STRONG&gt;Sum(Total)&lt;/STRONG&gt;&amp;lt;=$(vGroup1)"}&amp;gt;} customer_ID)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Mar 2015 07:57:26 GMT</pubDate>
    <dc:creator>tresB</dc:creator>
    <dc:date>2015-03-19T07:57:26Z</dc:date>
    <item>
      <title>complex Count statement</title>
      <link>https://community.qlik.com/t5/QlikView/complex-Count-statement/m-p/748146#M266950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a chart (table) where I am trying to do simulation on how many subjects will be affected by reaching particular goal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works correctly if I have single parameter:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count({&amp;lt;Total={'&amp;lt;=$(vGroup1)'}&amp;gt;} customer_ID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to count unique customer_ID instances where Total is equal or less number found in my variable vGroup1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, the thing is that the total amount is basically a sum of 10 different groups of numbers (think of different sales divisions within single customer_ID, and also it is possible that one customer_ID and one sales division have more transactions), something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG&gt;customer_ID, division, total&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;customer_1&amp;nbsp;&amp;nbsp; division1&amp;nbsp; 1000&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;customer_1&amp;nbsp;&amp;nbsp; division1&amp;nbsp; 500&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;customer_1&amp;nbsp;&amp;nbsp; division2&amp;nbsp; 700&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;customer_1&amp;nbsp;&amp;nbsp; division3&amp;nbsp; 100&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;customer_1&amp;nbsp;&amp;nbsp; division3&amp;nbsp; 2000&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;customer_2&amp;nbsp;&amp;nbsp; division1&amp;nbsp; 50&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;customer_2&amp;nbsp;&amp;nbsp; division1&amp;nbsp; 150&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;customer_2&amp;nbsp;&amp;nbsp; division2&amp;nbsp; 300&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;customer_2&amp;nbsp;&amp;nbsp; division3&amp;nbsp; 400&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;customer_2&amp;nbsp;&amp;nbsp; division3&amp;nbsp; 800&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and I want to have more then one variable involved, what I am trying to do is to do following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count all unique customer_ID whose sum of Total for the division1 is equal or less then vXxxx AND sum of Total for the division2 is equal or less then vYyyyy AND sum of Total for the division3 is equal or less then vZzzzz...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any ideas on how to make it happen?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2015 07:52:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/complex-Count-statement/m-p/748146#M266950</guid>
      <dc:creator>marko_rakar</dc:creator>
      <dc:date>2015-03-19T07:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: complex Count statement</title>
      <link>https://community.qlik.com/t5/QlikView/complex-Count-statement/m-p/748147#M266951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try like:&lt;/P&gt;&lt;P&gt;count({&amp;lt;&lt;STRONG&gt;customer_ID&lt;/STRONG&gt;={"=&lt;STRONG&gt;Sum(Total)&lt;/STRONG&gt;&amp;lt;=$(vGroup1)"}&amp;gt;} customer_ID)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2015 07:57:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/complex-Count-statement/m-p/748147#M266951</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2015-03-19T07:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: complex Count statement</title>
      <link>https://community.qlik.com/t5/QlikView/complex-Count-statement/m-p/748148#M266952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you provide few lines of sample data along with the result you are looking for?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2015 07:58:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/complex-Count-statement/m-p/748148#M266952</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2015-03-19T07:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: complex Count statement</title>
      <link>https://community.qlik.com/t5/QlikView/complex-Count-statement/m-p/748149#M266953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please find attached sample file with sample data.In the chart "Sum of all" in the most right collumn I have Complex count I wish to make.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently, in the saved file, my variable "Division 1 target" is set to 18 and in my Complex count it states that there are four "hits".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is incorrect, because there are four rows in my database which meet the criteria but there are only three distinct customers which are selected.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;So my first problem is to count correctly distinct customer_ID which is collumn F1 (this is not working at the moment, I just noticed that).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My second problem is that I want to introduce another variable vDivision2 so that my complex count will count all customers which have met criteria with their division 1 and division 2, for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;count(DISTINCT F1 where&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;sum of all rows F3 is equal or less then vDivision1 if field F2 is equal to 1 AND&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;sum of all rows F3 is equal or less then vDivision2 id field F2 is equal to 2&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, if I do this correctly and if I set slide Division 1 to the value of 65 (customers 1 and 4 meet this) and vDivision 2 to the value of 100 (customers 1 and 2 meet this) then correct number in my complex count should be 1 because only one customer meets both criteria (customer1). But, if I increase value in Division1 to 100, then correct answer is 2 because customer1 and customer2 meet criteria.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can it be done?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2015 08:36:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/complex-Count-statement/m-p/748149#M266953</guid>
      <dc:creator>marko_rakar</dc:creator>
      <dc:date>2015-03-19T08:36:38Z</dc:date>
    </item>
  </channel>
</rss>

