<?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: Linking Direct Discovery table twice in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Linking-Direct-Discovery-table-twice/m-p/1409960#M438138</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess the only way to workaround this direct query &lt;SPAN style="font-size: 13.3333px;"&gt;limitation &lt;/SPAN&gt;could be using a database view.&lt;/P&gt;&lt;P&gt;Thanks for your quick reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Andrea&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Sep 2017 15:21:06 GMT</pubDate>
    <dc:creator>agigliotti</dc:creator>
    <dc:date>2017-09-14T15:21:06Z</dc:date>
    <item>
      <title>Linking Direct Discovery table twice</title>
      <link>https://community.qlik.com/t5/QlikView/Linking-Direct-Discovery-table-twice/m-p/1409958#M438136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'd need to write an sql statement for direct query (DB2/400).&lt;/P&gt;&lt;P&gt;Specifically I need to join the same table twice using different where clause something similar below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DIRECT QUERY&lt;/P&gt;&lt;P&gt;DIMENSION&lt;/P&gt;&lt;P&gt;"ORDNUM" as "AliasColumn1",&lt;/P&gt;&lt;P&gt;"ORDNRG" as &lt;SPAN style="font-size: 13.3333px;"&gt;"AliasColumn2",&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;"ORDAGO" as "AliasColumn3"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MEASURE&lt;/P&gt;&lt;P&gt;ORDNUM,&lt;/P&gt;&lt;P&gt;ORDIFT,&lt;/P&gt;&lt;P&gt;ORDCRD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;FROM "library1"."table"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;JOIN "&lt;SPAN style="font-size: 13.3333px;"&gt;library2&lt;/SPAN&gt;"."table1"&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;ON (SUBSTR(&lt;SPAN style="font-size: 13.3333px;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;library2&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;"."table1"&lt;/SPAN&gt;."ATBKEY", 14, 2) =&lt;SPAN style="font-size: 13.3333px;"&gt;"library1"."table"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;."ORDTIP" and &lt;SPAN style="font-size: 13.3333px;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;library2&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;"."table1"&lt;/SPAN&gt;."ATBCOD" = 'C21')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;JOIN &lt;SPAN style="font-size: 13.3333px;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;library2&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;"."table1"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;ON (SUBSTR(&lt;SPAN style="font-size: 13.3333px;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;library2&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;"."table1"&lt;/SPAN&gt;."ATBKEY", 14, 2) =&lt;SPAN style="font-size: 13.3333px;"&gt;"library1"."table"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;."ORDTPR" and &lt;SPAN style="font-size: 13.3333px;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;library2&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;"."table1"&lt;/SPAN&gt;."ATBCOD" = 'C58')&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but It give me an error for &lt;SPAN style="font-size: 13.3333px;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;library2&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;"."table1" duplicated !&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;I read on direct discovery &lt;SPAN style="font-size: 13.3333px;"&gt;documentation &lt;/SPAN&gt;as below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #0f0f0f; font-family: 'Open Sans', Arial, sans-serif; font-size: 14px; background-color: #f4f4f4;"&gt;It is not possible to refer to tables by alias in the &lt;/SPAN&gt;&lt;SPAN class="statement" style="font-weight: bold; color: #0f0f0f; font-family: 'Open Sans', Arial, sans-serif; font-size: 14px;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="color: #0f0f0f; font-family: 'Open Sans', Arial, sans-serif; font-size: 14px; background-color: #f4f4f4;"&gt; clause, you need to use the full table name.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Can someone help me with this ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Many thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Andrea&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2017 14:32:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Linking-Direct-Discovery-table-twice/m-p/1409958#M438136</guid>
      <dc:creator>agigliotti</dc:creator>
      <dc:date>2017-09-13T14:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: Linking Direct Discovery table twice</title>
      <link>https://community.qlik.com/t5/QlikView/Linking-Direct-Discovery-table-twice/m-p/1409959#M438137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andrea,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not a huge expert on complex SQL statements, but it looks like the problem is caused by using the same table twice in the same SQL statement. I think you might be able to go around the problem by creating two separate views for the same table, with different WHERE conditions, and then refer to different views in your JOIN ON statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Oleg Troyansky&lt;/P&gt;&lt;P&gt;Upgrade your Qlik skills at the &lt;A href="https://masterssummit.com/"&gt;Masters Summit for Qlik&lt;/A&gt; - coming to Boston, MA this October!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Sep 2017 15:14:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Linking-Direct-Discovery-table-twice/m-p/1409959#M438137</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2017-09-14T15:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: Linking Direct Discovery table twice</title>
      <link>https://community.qlik.com/t5/QlikView/Linking-Direct-Discovery-table-twice/m-p/1409960#M438138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess the only way to workaround this direct query &lt;SPAN style="font-size: 13.3333px;"&gt;limitation &lt;/SPAN&gt;could be using a database view.&lt;/P&gt;&lt;P&gt;Thanks for your quick reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Andrea&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Sep 2017 15:21:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Linking-Direct-Discovery-table-twice/m-p/1409960#M438138</guid>
      <dc:creator>agigliotti</dc:creator>
      <dc:date>2017-09-14T15:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: Linking Direct Discovery table twice</title>
      <link>https://community.qlik.com/t5/QlikView/Linking-Direct-Discovery-table-twice/m-p/1409961#M438139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The &lt;A _jive_internal="true" href="https://community.qlik.com/docs/DOC-8537"&gt;Technical Addendum&lt;/A&gt; for the Direct Discovery documentation states some limitations when using multiple tables, which is supported and should work.&lt;/P&gt;&lt;P&gt;Nevertheless, you may want to try as in the examples (see 3.8.2 or 3.8.3 in the doc above).&lt;/P&gt;&lt;P&gt;See also 3.8 with regards to limitations for multiple tables, for example the cardinality rule. Indeed, creating a view, if possible, would be also my preferred solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Sep 2017 16:09:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Linking-Direct-Discovery-table-twice/m-p/1409961#M438139</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2017-09-14T16:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: Linking Direct Discovery table twice</title>
      <link>https://community.qlik.com/t5/QlikView/Linking-Direct-Discovery-table-twice/m-p/1409962#M438140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;does is possible to use CASE statement in DIRECT QUERY ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Sep 2017 15:18:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Linking-Direct-Discovery-table-twice/m-p/1409962#M438140</guid>
      <dc:creator>agigliotti</dc:creator>
      <dc:date>2017-09-18T15:18:40Z</dc:date>
    </item>
  </channel>
</rss>

