<?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 distinct based on 2 conditions in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/count-distinct-based-on-2-conditions/m-p/1189168#M518775</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use set analysis like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Count({&amp;lt;date1={"&amp;gt;=1&amp;lt;=4"}&amp;gt;+&amp;lt;date1={"&amp;gt;=5&amp;lt;=9"}&amp;gt;} DISTINCT codes1)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Sep 2016 15:51:51 GMT</pubDate>
    <dc:creator>stigchel</dc:creator>
    <dc:date>2016-09-21T15:51:51Z</dc:date>
    <item>
      <title>count distinct based on 2 conditions</title>
      <link>https://community.qlik.com/t5/QlikView/count-distinct-based-on-2-conditions/m-p/1189167#M518774</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;Could someone help me in writing the expression which should fetch the count of distinct values based on 2 conditions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/138127_pastedImage_2.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;In the screenshot, there are 2 list boxes with 2 different expressions. How do I fetch the count of distinct values in both the list boxes combined?&lt;/P&gt;&lt;P&gt;That is, by seeing the list boxes I know 003, 005 appear in both list boxes, however I would like to have the count of distinct values from both the list boxes combined. (conditions).&lt;/P&gt;&lt;P&gt;So, according to the data in the screenshot, The value I want is "9" because I have 9 distinct values from both the list boxes combined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: Working on the script side doesn't work for this case because the condition is triggered by selections in the layout.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am attaching the qvw for reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2016 05:16:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-distinct-based-on-2-conditions/m-p/1189167#M518774</guid>
      <dc:creator>divya_anand</dc:creator>
      <dc:date>2016-09-21T05:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: count distinct based on 2 conditions</title>
      <link>https://community.qlik.com/t5/QlikView/count-distinct-based-on-2-conditions/m-p/1189168#M518775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use set analysis like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Count({&amp;lt;date1={"&amp;gt;=1&amp;lt;=4"}&amp;gt;+&amp;lt;date1={"&amp;gt;=5&amp;lt;=9"}&amp;gt;} DISTINCT codes1)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2016 15:51:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-distinct-based-on-2-conditions/m-p/1189168#M518775</guid>
      <dc:creator>stigchel</dc:creator>
      <dc:date>2016-09-21T15:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: count distinct based on 2 conditions</title>
      <link>https://community.qlik.com/t5/QlikView/count-distinct-based-on-2-conditions/m-p/1189169#M518776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can concat the two fields in your script and then count distinct of that field&lt;/P&gt;&lt;P&gt;Code1 &amp;amp; '|' &amp;amp; Date1 as NewField&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count(Distinct NewField)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2016 15:56:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-distinct-based-on-2-conditions/m-p/1189169#M518776</guid>
      <dc:creator>neelamsaroha157</dc:creator>
      <dc:date>2016-09-21T15:56:08Z</dc:date>
    </item>
  </channel>
</rss>

