<?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 multiple SQL lines (; ) in Qlik Script in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/multiple-SQL-lines-in-Qlik-Script/m-p/1825323#M9369</link>
    <description>&lt;P&gt;hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to run a SQL statement that creates a few TEMP tables and then applies some joins to those tables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The query runs just fine in the IDE but when running it in Qlik Sense script, the reload fails. the reason is that the query contains multiple semicolons (;), indicating the end of the SQL, or at least that's what Qlik thinks and ignoring the rest of the SQL, causing a syntax error at the reload time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;here's a simplified version of the SQl I'm trying to run in qlik:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;CREATE TEMP TABLE Eng as (&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;select distinct FIELD_A&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;from SCHEMA.fact_table&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;)&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;;&amp;nbsp; // first semicolon&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;CREATE TEMP TABLE phone_calls as (&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;SELECT das.*&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;FROM SCHEMA.fact_table_TWO das&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;)&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;; // second semicolon&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;select *&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;from Eng&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;left join phone_calls on phone_calls.key_field_1 = Eng.key_field_2&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;; // last semicolon&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;thank you all!&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Jul 2021 21:29:31 GMT</pubDate>
    <dc:creator>mohedano</dc:creator>
    <dc:date>2021-07-28T21:29:31Z</dc:date>
    <item>
      <title>multiple SQL lines (; ) in Qlik Script</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/multiple-SQL-lines-in-Qlik-Script/m-p/1825323#M9369</link>
      <description>&lt;P&gt;hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to run a SQL statement that creates a few TEMP tables and then applies some joins to those tables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The query runs just fine in the IDE but when running it in Qlik Sense script, the reload fails. the reason is that the query contains multiple semicolons (;), indicating the end of the SQL, or at least that's what Qlik thinks and ignoring the rest of the SQL, causing a syntax error at the reload time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;here's a simplified version of the SQl I'm trying to run in qlik:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;CREATE TEMP TABLE Eng as (&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;select distinct FIELD_A&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;from SCHEMA.fact_table&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;)&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;;&amp;nbsp; // first semicolon&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;CREATE TEMP TABLE phone_calls as (&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;SELECT das.*&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;FROM SCHEMA.fact_table_TWO das&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;)&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;; // second semicolon&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;select *&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;from Eng&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;left join phone_calls on phone_calls.key_field_1 = Eng.key_field_2&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;; // last semicolon&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;thank you all!&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 21:29:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/multiple-SQL-lines-in-Qlik-Script/m-p/1825323#M9369</guid>
      <dc:creator>mohedano</dc:creator>
      <dc:date>2021-07-28T21:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: multiple SQL lines (; ) in Qlik Script</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/multiple-SQL-lines-in-Qlik-Script/m-p/1825379#M9370</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Create statement won't work in Qliksense.&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" color="#000000"&gt;CREATE TEMP TABLE Eng as (&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" color="#000000"&gt;select distinct FIELD_A&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#000000"&gt;from SCHEMA.fact_table&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" color="#000000"&gt;)&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" color="#000000"&gt;&lt;STRONG&gt;instead of this, try like below&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" color="#000000"&gt;&lt;STRONG&gt;FactTabletemp:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" color="#000000"&gt;select distinct FIELD_A&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#000000"&gt;from SCHEMA.fact_table;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" color="#000000"&gt;FactTabletemp &amp;lt;-- this table contains the distinct values from fieldA&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" color="#000000"&gt;Hope its helps you&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 06:49:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/multiple-SQL-lines-in-Qlik-Script/m-p/1825379#M9370</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2021-07-29T06:49:43Z</dc:date>
    </item>
  </channel>
</rss>

