<?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 with conditionals in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-with-conditionals/m-p/1912424#M1231999</link>
    <description>&lt;P&gt;I would like to apply the distinct to the Product ID, I think your suggested expression does not include than (distinct is apparently acting on model)&lt;/P&gt;</description>
    <pubDate>Thu, 31 Mar 2022 11:36:17 GMT</pubDate>
    <dc:creator>antupe</dc:creator>
    <dc:date>2022-03-31T11:36:17Z</dc:date>
    <item>
      <title>Count with conditionals</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-conditionals/m-p/1912397#M1231996</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have product ID, Model and Broken as imported variables. The same product ID may appear more than once in the table (for other reasons) and this must not be changed.&lt;/P&gt;
&lt;P&gt;Any recommendations on how I could do a count of each model where broken=0 and where if the ID is repeated, it is only counted once?&lt;/P&gt;
&lt;P&gt;I was using:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;=count(if((Broken='No'),[Model]))&lt;/EM&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;but I am not sure how to implement the distinct(ProductID) in the expression.&lt;/P&gt;
&lt;P&gt;Thank you in advance&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jan 2026 16:26:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-conditionals/m-p/1912397#M1231996</guid>
      <dc:creator>antupe</dc:creator>
      <dc:date>2026-01-26T16:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: Count with conditionals</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-conditionals/m-p/1912400#M1231998</link>
      <description>&lt;P&gt;Count(distinct {&amp;lt; Broken = {'No'} &amp;gt;} Model) should work. Using set analysis rather than if() is recommended when possible, generally speaking. &lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2022 10:51:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-conditionals/m-p/1912400#M1231998</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2022-03-31T10:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: Count with conditionals</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-conditionals/m-p/1912424#M1231999</link>
      <description>&lt;P&gt;I would like to apply the distinct to the Product ID, I think your suggested expression does not include than (distinct is apparently acting on model)&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2022 11:36:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-conditionals/m-p/1912424#M1231999</guid>
      <dc:creator>antupe</dc:creator>
      <dc:date>2022-03-31T11:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: Count with conditionals</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-conditionals/m-p/1912426#M1232000</link>
      <description>&lt;P&gt;Then you should just count Product ID instead of Model. Since it's a count distinct, there won't be repetitions.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2022 11:46:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-conditionals/m-p/1912426#M1232000</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2022-03-31T11:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: Count with conditionals</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-conditionals/m-p/1912433#M1232001</link>
      <description>&lt;P&gt;Sorry I think I may not have explained myself very clearly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is an example of the information I have:&lt;/P&gt;
&lt;TABLE border="1" width="97.78357235984355%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;Product ID&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;Model&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;Broken&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;
&lt;P&gt;001&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;A&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;No&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;010&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;B&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;No&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;002&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;A&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;No&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;004&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;A&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;No&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;010&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;B&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;No&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;006&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;A&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;Yes&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;004&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;A&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;No&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;012&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;B&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;No&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;As you can see there are repeated IDs that must remain so because of other variables not mentioned here.&lt;/P&gt;
&lt;P&gt;I would like to have the total number of items that are of Model A and of Model B (this is a simplification, there are more), where the state of broken is 'No'. As some IDs are repeated I would like to count these only once in the model count.&lt;/P&gt;
&lt;P&gt;So for this example my expected result would be&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Model&lt;/P&gt;
&lt;P&gt;A=3 (corresponding to 001, 002, 004, not 006 because the state for broken is 'Yes')&lt;/P&gt;
&lt;P&gt;B=2 (corresponding to 010, 012)&lt;/P&gt;
&lt;P&gt;Sorry for the unclear initial explanation&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2022 12:03:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-conditionals/m-p/1912433#M1232001</guid>
      <dc:creator>antupe</dc:creator>
      <dc:date>2022-03-31T12:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: Count with conditionals</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-conditionals/m-p/1912441#M1232002</link>
      <description>&lt;P&gt;I actually think it was pretty clear in the first place, but I'm not sure how this differs from the suggested solution. Model is your dimension, and the expression is what I suggested above (replacing Product ID for Model in the count distinct).&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2022 12:21:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-conditionals/m-p/1912441#M1232002</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2022-03-31T12:21:35Z</dc:date>
    </item>
  </channel>
</rss>

