<?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 Counting distinct values conditionally in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Counting-distinct-values-conditionally/m-p/1722350#M54964</link>
    <description>&lt;P&gt;Hi.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have data that looks like this: Say for June&lt;/P&gt;&lt;TABLE border="1" width="56.25%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;EventName&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;CustomerID&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;StockRequest&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;29835&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;StockRequest&lt;/TD&gt;&lt;TD&gt;29835&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;StockRequest&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;29402&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;Checkout&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;29835&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="25px"&gt;Checkout&lt;/TD&gt;&lt;TD height="25px"&gt;29402&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if I just do count(distinct CustomerID) it returns 4. I want to count the number of distinct stock requests. So customer&amp;nbsp;29835 had two stock requests, but I just want to count it as 1.&amp;nbsp; So it should return 2 for june.&lt;/P&gt;</description>
    <pubDate>Mon, 20 Dec 2021 21:08:46 GMT</pubDate>
    <dc:creator>shirleyc40</dc:creator>
    <dc:date>2021-12-20T21:08:46Z</dc:date>
    <item>
      <title>Counting distinct values conditionally</title>
      <link>https://community.qlik.com/t5/App-Development/Counting-distinct-values-conditionally/m-p/1722350#M54964</link>
      <description>&lt;P&gt;Hi.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have data that looks like this: Say for June&lt;/P&gt;&lt;TABLE border="1" width="56.25%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;EventName&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;CustomerID&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;StockRequest&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;29835&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;StockRequest&lt;/TD&gt;&lt;TD&gt;29835&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;StockRequest&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;29402&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;Checkout&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;29835&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="25px"&gt;Checkout&lt;/TD&gt;&lt;TD height="25px"&gt;29402&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if I just do count(distinct CustomerID) it returns 4. I want to count the number of distinct stock requests. So customer&amp;nbsp;29835 had two stock requests, but I just want to count it as 1.&amp;nbsp; So it should return 2 for june.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 21:08:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Counting-distinct-values-conditionally/m-p/1722350#M54964</guid>
      <dc:creator>shirleyc40</dc:creator>
      <dc:date>2021-12-20T21:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: Counting distinct values conditionally</title>
      <link>https://community.qlik.com/t5/App-Development/Counting-distinct-values-conditionally/m-p/1722388#M54968</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/118836"&gt;@shirleyc40&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't find the same values&lt;/P&gt;&lt;P&gt;for distinct customer :&lt;/P&gt;&lt;LI-CODE lang="python"&gt;=count(distinct CustomerID) &lt;/LI-CODE&gt;&lt;P&gt;it return 2&lt;/P&gt;&lt;P&gt;and for number of distinct stock requests&lt;/P&gt;&lt;LI-CODE lang="python"&gt;=count({&amp;lt;EventName={'StockRequest'}&amp;gt;} distinct CustomerID) &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;return also 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 848px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/36308iCF409AFE1BF2FE43/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jun 2020 21:43:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Counting-distinct-values-conditionally/m-p/1722388#M54968</guid>
      <dc:creator>Taoufiq_Zarra</dc:creator>
      <dc:date>2020-06-25T21:43:50Z</dc:date>
    </item>
  </channel>
</rss>

