<?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 Tables Creating Syn keys although queries are in two different sections in Data Movement &amp; Streaming</title>
    <link>https://community.qlik.com/t5/Data-Movement-Streaming/Tables-Creating-Syn-keys-although-queries-are-in-two-different/m-p/2498629#M2947</link>
    <description>&lt;P&gt;Hello everyone, I have two SQL queries where the tables have the same names. I assumed that if I put these two queries into their own sections that I'd get data from the two and have a relationship between all of my tables, but instead I get syn keys generated. If I give the field names a unique alias then the tables don't create a relationship. If I use Qualify* at the top of the SQL, the fields are loaded as tablename.fieldname, and again no joy on a relationship. I have googled this several different ways but no joy. Below are the two queries.&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[Upcoming PI Reports]:
Load *;

[Upcoming PI Reports]:
SQL
SELECT	distinct (case when AB.EPA_ID is not null then AB.EPA_ID else RAB.EPA_ID end) EPA_ID
                , ARS.ABSTRACT_ID as ABS_ID
                , (case when AB.ABS_TYPE is not null then AB.ABS_TYPE else RAB.ABS_TYPE end) AS AbsType
                , ARS.RPT_YR AS RptYr
                , ARS.START_DATE AS RptSDate
                , ARS.END_DATE AS RptEDate
                , ARS.DUE_DATE AS RptDue
                , (CASE WHEN ARS.RPT_YR = 'F' THEN 'Final Report' ELSE ARS.RPT_YR || ' Annual Report' END) AS RptYrLbl
                , ARS.PO
                FROM ABSTRACT AB, RPU_ABSTRACT RAB
                , APU_REPORT_STATUS ARS
                WHERE ARS.ABSTRACT_ID = AB.ABSTRACT_ID (+)
                AND ARS.ABSTRACT_ID = RAB.ABSTRACT_ID (+)
                and ON_WEB = 0
                and IS_SUPPRESS = 0
                and IS_IN_PROCESS = 0
                and IS_PUB_WF = 0
                and IS_REQUIRE = 1
  			 	
           AND (lower(AB.ABS_TYPE) in ('grant','centers','sbir')
           		OR lower(RAB.ABS_TYPE) in ('grant','centers','sbir'))
           
           		and (ROUND(ARS.DUE_DATE - SYSDATE) &amp;gt; 0)
                
                and (ROUND(ARS.DUE_DATE - SYSDATE) &amp;lt;90)
                
		ORDER BY
				
				ARS.DUE_DATE, 1, ARS.RPT_YR;

[Late PI Report]:
Load *;

[Late PI Report]:
SQL
SELECT	distinct (case when AB.EPA_ID is not null then AB.EPA_ID else RAB.EPA_ID end) EPA_ID
                , ARS.ABSTRACT_ID as ABS_ID
                , (case when AB.ABS_TYPE is not null then AB.ABS_TYPE else RAB.ABS_TYPE end) AS AbsType
                , ARS.RPT_YR AS RptYr
                , ARS.START_DATE AS RptSDate
                , ARS.END_DATE AS RptEDate
                , ARS.DUE_DATE AS RptDue
                , (CASE WHEN ARS.RPT_YR = 'F' THEN 'Final Report' ELSE ARS.RPT_YR || ' Annual Report' END) AS RptYrLbl
                , ARS.PO
                FROM ABSTRACT AB, RPU_ABSTRACT RAB
                , APU_REPORT_STATUS ARS
                WHERE ARS.ABSTRACT_ID = AB.ABSTRACT_ID (+)
                AND ARS.ABSTRACT_ID = RAB.ABSTRACT_ID (+)
                and ON_WEB = 0
                and IS_SUPPRESS = 0
                and IS_IN_PROCESS = 0
                and IS_PUB_WF = 0
                and IS_REQUIRE = 1
  			 	
           AND (lower(AB.ABS_TYPE) in ('grant','centers','sbir')
           		OR lower(RAB.ABS_TYPE) in ('grant','centers','sbir'))
           
                and (ROUND(SYSDATE - ARS.DUE_DATE) &amp;gt; 0)
                
                and (ROUND(SYSDATE - ARS.DUE_DATE) &amp;lt;150)
                ORDER BY
				
				ARS.DUE_DATE, 1, ARS.RPT_YR;
                

&lt;/LI-CODE&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
    <pubDate>Wed, 19 Mar 2025 21:46:28 GMT</pubDate>
    <dc:creator>bruce_sorge</dc:creator>
    <dc:date>2025-03-19T21:46:28Z</dc:date>
    <item>
      <title>Tables Creating Syn keys although queries are in two different sections</title>
      <link>https://community.qlik.com/t5/Data-Movement-Streaming/Tables-Creating-Syn-keys-although-queries-are-in-two-different/m-p/2498629#M2947</link>
      <description>&lt;P&gt;Hello everyone, I have two SQL queries where the tables have the same names. I assumed that if I put these two queries into their own sections that I'd get data from the two and have a relationship between all of my tables, but instead I get syn keys generated. If I give the field names a unique alias then the tables don't create a relationship. If I use Qualify* at the top of the SQL, the fields are loaded as tablename.fieldname, and again no joy on a relationship. I have googled this several different ways but no joy. Below are the two queries.&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[Upcoming PI Reports]:
Load *;

[Upcoming PI Reports]:
SQL
SELECT	distinct (case when AB.EPA_ID is not null then AB.EPA_ID else RAB.EPA_ID end) EPA_ID
                , ARS.ABSTRACT_ID as ABS_ID
                , (case when AB.ABS_TYPE is not null then AB.ABS_TYPE else RAB.ABS_TYPE end) AS AbsType
                , ARS.RPT_YR AS RptYr
                , ARS.START_DATE AS RptSDate
                , ARS.END_DATE AS RptEDate
                , ARS.DUE_DATE AS RptDue
                , (CASE WHEN ARS.RPT_YR = 'F' THEN 'Final Report' ELSE ARS.RPT_YR || ' Annual Report' END) AS RptYrLbl
                , ARS.PO
                FROM ABSTRACT AB, RPU_ABSTRACT RAB
                , APU_REPORT_STATUS ARS
                WHERE ARS.ABSTRACT_ID = AB.ABSTRACT_ID (+)
                AND ARS.ABSTRACT_ID = RAB.ABSTRACT_ID (+)
                and ON_WEB = 0
                and IS_SUPPRESS = 0
                and IS_IN_PROCESS = 0
                and IS_PUB_WF = 0
                and IS_REQUIRE = 1
  			 	
           AND (lower(AB.ABS_TYPE) in ('grant','centers','sbir')
           		OR lower(RAB.ABS_TYPE) in ('grant','centers','sbir'))
           
           		and (ROUND(ARS.DUE_DATE - SYSDATE) &amp;gt; 0)
                
                and (ROUND(ARS.DUE_DATE - SYSDATE) &amp;lt;90)
                
		ORDER BY
				
				ARS.DUE_DATE, 1, ARS.RPT_YR;

[Late PI Report]:
Load *;

[Late PI Report]:
SQL
SELECT	distinct (case when AB.EPA_ID is not null then AB.EPA_ID else RAB.EPA_ID end) EPA_ID
                , ARS.ABSTRACT_ID as ABS_ID
                , (case when AB.ABS_TYPE is not null then AB.ABS_TYPE else RAB.ABS_TYPE end) AS AbsType
                , ARS.RPT_YR AS RptYr
                , ARS.START_DATE AS RptSDate
                , ARS.END_DATE AS RptEDate
                , ARS.DUE_DATE AS RptDue
                , (CASE WHEN ARS.RPT_YR = 'F' THEN 'Final Report' ELSE ARS.RPT_YR || ' Annual Report' END) AS RptYrLbl
                , ARS.PO
                FROM ABSTRACT AB, RPU_ABSTRACT RAB
                , APU_REPORT_STATUS ARS
                WHERE ARS.ABSTRACT_ID = AB.ABSTRACT_ID (+)
                AND ARS.ABSTRACT_ID = RAB.ABSTRACT_ID (+)
                and ON_WEB = 0
                and IS_SUPPRESS = 0
                and IS_IN_PROCESS = 0
                and IS_PUB_WF = 0
                and IS_REQUIRE = 1
  			 	
           AND (lower(AB.ABS_TYPE) in ('grant','centers','sbir')
           		OR lower(RAB.ABS_TYPE) in ('grant','centers','sbir'))
           
                and (ROUND(SYSDATE - ARS.DUE_DATE) &amp;gt; 0)
                
                and (ROUND(SYSDATE - ARS.DUE_DATE) &amp;lt;150)
                ORDER BY
				
				ARS.DUE_DATE, 1, ARS.RPT_YR;
                

&lt;/LI-CODE&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2025 21:46:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Data-Movement-Streaming/Tables-Creating-Syn-keys-although-queries-are-in-two-different/m-p/2498629#M2947</guid>
      <dc:creator>bruce_sorge</dc:creator>
      <dc:date>2025-03-19T21:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: Tables Creating Syn keys although queries are in two different sections</title>
      <link>https://community.qlik.com/t5/Data-Movement-Streaming/Tables-Creating-Syn-keys-although-queries-are-in-two-different/m-p/2498637#M2948</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;If you only have one field that serves as a key you can add&lt;/P&gt;
&lt;P&gt;Qualify *;&lt;BR /&gt;Unqualify KeyField ;&lt;/P&gt;
&lt;P&gt;Load ...&lt;/P&gt;
&lt;P&gt;This will keep different names between tables to avoid synthetic keys, except for the key field that will serve as a link.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2024 16:12:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Data-Movement-Streaming/Tables-Creating-Syn-keys-although-queries-are-in-two-different/m-p/2498637#M2948</guid>
      <dc:creator>Clement15</dc:creator>
      <dc:date>2024-12-18T16:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: Tables Creating Syn keys although queries are in two different sections</title>
      <link>https://community.qlik.com/t5/Data-Movement-Streaming/Tables-Creating-Syn-keys-although-queries-are-in-two-different/m-p/2498641#M2949</link>
      <description>&lt;P&gt;That did the trick. Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2024 16:32:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Data-Movement-Streaming/Tables-Creating-Syn-keys-although-queries-are-in-two-different/m-p/2498641#M2949</guid>
      <dc:creator>bruce_sorge</dc:creator>
      <dc:date>2024-12-18T16:32:04Z</dc:date>
    </item>
  </channel>
</rss>

