<?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 Count total distincts from two tables in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Count-total-distincts-from-two-tables/m-p/1671480#M63663</link>
    <description>&lt;P&gt;I have one&lt;U&gt; order table&lt;/U&gt; with&lt;STRONG&gt;&lt;EM&gt; OrderNo&lt;/EM&gt;&lt;/STRONG&gt;, one &lt;U&gt;invoice table&lt;/U&gt; with&lt;STRONG&gt;&lt;EM&gt; InvoiceNo&lt;/EM&gt;&lt;/STRONG&gt; and &lt;STRONG&gt;&lt;EM&gt;OriginalOrderNo&lt;/EM&gt;&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;I would like to count the total distinct order numbers from both tables. I'm using:&lt;/P&gt;&lt;P&gt;Count(distinct OrderNo) + Count(distinct OriginalOrderNo)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the problem is, there would be partial invoices. For example, &lt;STRONG&gt;&lt;EM&gt;OrderNo1&lt;/EM&gt; &lt;/STRONG&gt;has been partially invoiced, it will still be in order table with &lt;EM&gt;&lt;STRONG&gt;OrderNo1&lt;/STRONG&gt;&lt;/EM&gt;, as will as be in invoice table as &lt;EM&gt;&lt;STRONG&gt;InvoiceNo1&lt;/STRONG&gt; &lt;/EM&gt;and &lt;EM&gt;&lt;STRONG&gt;OriginalOrderNo1&lt;/STRONG&gt;&lt;/EM&gt;. So it should be counted once. However, in my function the result is 2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How should I update my function? Any advice helps! Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Fri, 02 Apr 2021 08:17:11 GMT</pubDate>
    <dc:creator>wanyunyang</dc:creator>
    <dc:date>2021-04-02T08:17:11Z</dc:date>
    <item>
      <title>Count total distincts from two tables</title>
      <link>https://community.qlik.com/t5/App-Development/Count-total-distincts-from-two-tables/m-p/1671480#M63663</link>
      <description>&lt;P&gt;I have one&lt;U&gt; order table&lt;/U&gt; with&lt;STRONG&gt;&lt;EM&gt; OrderNo&lt;/EM&gt;&lt;/STRONG&gt;, one &lt;U&gt;invoice table&lt;/U&gt; with&lt;STRONG&gt;&lt;EM&gt; InvoiceNo&lt;/EM&gt;&lt;/STRONG&gt; and &lt;STRONG&gt;&lt;EM&gt;OriginalOrderNo&lt;/EM&gt;&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;I would like to count the total distinct order numbers from both tables. I'm using:&lt;/P&gt;&lt;P&gt;Count(distinct OrderNo) + Count(distinct OriginalOrderNo)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the problem is, there would be partial invoices. For example, &lt;STRONG&gt;&lt;EM&gt;OrderNo1&lt;/EM&gt; &lt;/STRONG&gt;has been partially invoiced, it will still be in order table with &lt;EM&gt;&lt;STRONG&gt;OrderNo1&lt;/STRONG&gt;&lt;/EM&gt;, as will as be in invoice table as &lt;EM&gt;&lt;STRONG&gt;InvoiceNo1&lt;/STRONG&gt; &lt;/EM&gt;and &lt;EM&gt;&lt;STRONG&gt;OriginalOrderNo1&lt;/STRONG&gt;&lt;/EM&gt;. So it should be counted once. However, in my function the result is 2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How should I update my function? Any advice helps! Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Fri, 02 Apr 2021 08:17:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-total-distincts-from-two-tables/m-p/1671480#M63663</guid>
      <dc:creator>wanyunyang</dc:creator>
      <dc:date>2021-04-02T08:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: Count total distincts from two tables</title>
      <link>https://community.qlik.com/t5/App-Development/Count-total-distincts-from-two-tables/m-p/1671485#M63664</link>
      <description>&lt;P&gt;Try the&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/ChartFunctions/SetAnalysis/set-modifiers-implicit-field-value-definitions.htm" target="_self"&gt;P Function&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Count(distinct OrderNo) + Count({&amp;lt;OriginalOrderNo-=P(OrderNo)&amp;gt;}distinct OriginalOrderNo)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 22:44:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-total-distincts-from-two-tables/m-p/1671485#M63664</guid>
      <dc:creator>jwjackso</dc:creator>
      <dc:date>2020-01-31T22:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: Count total distincts from two tables</title>
      <link>https://community.qlik.com/t5/App-Development/Count-total-distincts-from-two-tables/m-p/1671486#M63665</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thank you for your reply! I tried this function but didn't work. I think it's because I have set analysis like:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Count({&amp;lt;OrderDate={'01/01/2020'}&amp;gt;}distinct OrderNo) &lt;/SPAN&gt;&lt;SPAN&gt;+ &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Count({&amp;lt;OriginalOrderNo-=P(OrderNo),OrderDate={'01/01/2020'}&amp;gt;}distinct OriginalOrderNo)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 22:47:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-total-distincts-from-two-tables/m-p/1671486#M63665</guid>
      <dc:creator>wanyunyang</dc:creator>
      <dc:date>2020-01-31T22:47:40Z</dc:date>
    </item>
  </channel>
</rss>

