<?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 Specify field when the field-name is the same across multiple tables in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Specify-field-when-the-field-name-is-the-same-across-multiple/m-p/1747058#M57388</link>
    <description>&lt;P&gt;I have two tables "Customer" and "Employees" where we have a field "ID" in both of the tables.&lt;/P&gt;&lt;P&gt;Say I want to do a "COUNT(DISTINCT(ID))" for both, how do I specify when the "ID" should be from "Customer"-table and when it should be from "Employess"?&lt;/P&gt;</description>
    <pubDate>Fri, 25 Sep 2020 07:54:12 GMT</pubDate>
    <dc:creator>jakobjensen</dc:creator>
    <dc:date>2020-09-25T07:54:12Z</dc:date>
    <item>
      <title>Specify field when the field-name is the same across multiple tables</title>
      <link>https://community.qlik.com/t5/App-Development/Specify-field-when-the-field-name-is-the-same-across-multiple/m-p/1747058#M57388</link>
      <description>&lt;P&gt;I have two tables "Customer" and "Employees" where we have a field "ID" in both of the tables.&lt;/P&gt;&lt;P&gt;Say I want to do a "COUNT(DISTINCT(ID))" for both, how do I specify when the "ID" should be from "Customer"-table and when it should be from "Employess"?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 07:54:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Specify-field-when-the-field-name-is-the-same-across-multiple/m-p/1747058#M57388</guid>
      <dc:creator>jakobjensen</dc:creator>
      <dc:date>2020-09-25T07:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: Specify field when the field-name is the same across multiple tables</title>
      <link>https://community.qlik.com/t5/App-Development/Specify-field-when-the-field-name-is-the-same-across-multiple/m-p/1747079#M57389</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You will want to create extra fields in each of the tables at load. If you need a distinct count you will need to put that in both tables. If you only need a count of rows adding a 1 to each row in each table will be&amp;nbsp;&lt;STRONG&gt;much&lt;/STRONG&gt; more efficient. I always add a counter to every table I create, to have an efficient way of counting rows.&lt;/P&gt;&lt;P&gt;The code would be like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Customer:
LOAD
  1 as CustomerCount,
  ID,
  ID as CustomerID,
  ...

Employee:
LOAD
  1 as EmployeeCount,
  ID,
  ID as EmployeeID,
  ...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can then use the following expressions;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sum(CustomerCount)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sum(EmployeeCount)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;count(DISTINCT CustomerID)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;count(DISTINCT EmployeeID)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;or for the superset of IDs the expression you already have&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;count(DISTINCT ID)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 08:35:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Specify-field-when-the-field-name-is-the-same-across-multiple/m-p/1747079#M57389</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2020-09-25T08:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: Specify field when the field-name is the same across multiple tables</title>
      <link>https://community.qlik.com/t5/App-Development/Specify-field-when-the-field-name-is-the-same-across-multiple/m-p/1747084#M57390</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/124874"&gt;@jakobjensen&lt;/a&gt;&amp;nbsp; can you share a sample data and the expected output ?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 08:39:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Specify-field-when-the-field-name-is-the-same-across-multiple/m-p/1747084#M57390</guid>
      <dc:creator>Taoufiq_Zarra</dc:creator>
      <dc:date>2020-09-25T08:39:56Z</dc:date>
    </item>
  </channel>
</rss>

