Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
mohedano
Contributor II
Contributor II

multiple SQL lines (; ) in Qlik Script

hi all, 

I'm trying to run a SQL statement that creates a few TEMP tables and then applies some joins to those tables. 

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. 


here's a simplified version of the SQl I'm trying to run in qlik:


CREATE TEMP TABLE Eng as (

select distinct FIELD_A
from SCHEMA.fact_table

);  // first semicolon 


CREATE TEMP TABLE phone_calls as (

SELECT das.*
FROM SCHEMA.fact_table_TWO das
); // second semicolon 

 

select *
from Eng
left join phone_calls on phone_calls.key_field_1 = Eng.key_field_2
; // last semicolon 

 

 

thank you all!

1 Reply
MayilVahanan

Hi

Create statement won't work in Qliksense.

CREATE TEMP TABLE Eng as (

select distinct FIELD_A
from SCHEMA.fact_table

);

instead of this, try like below

FactTabletemp:

select distinct FIELD_A
from SCHEMA.fact_table;

FactTabletemp <-- this table contains the distinct values from fieldA

Hope its helps you

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.