Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
qlikmark1990
New Contributor III

Create temporary table in SQL and insert values doesn't work in QLIikSense

For testing purposes I tried to create two temporary tables in A QLikSense script, written in SQL. My code is:

LIB CONNECT TO 'db02';

SQL

CREATE TABLE #A
(
    Nr int, 
    helft1 Varchar(1)
)

CREATE TABLE #B
(
    Nr int, 
    helft2 Varchar(1)
)

INSERT INTO #A VALUES (1, 'A')
INSERT INTO #A VALUES (2, 'B')
INSERT INTO #A VALUES (3, 'C')

INSERT INTO #B VALUES (4, 'D')
INSERT INTO #B VALUES (5, 'E')
INSERT INTO #B VALUES (6, 'F')

SELECT * FROM #A

SELECT * FROM #B

;

When I run the script I don't get any error messages:

Laden van gegevens gestart

Er worden verbinding gemaakt met db02
Verbonden
Zoekindex maken
Maken van zoekindex is voltooid

App opgeslagen

Voltooid
0 geforceerde fout(en)
0 synthetische sleutel(s)

My meaning is to create the two tables in SQL temporary and after querying this tables, get them in the model viewer of QLikSense. At the moment I don't get any data in my application. What am I doing wrong. My goal is to use SQL to manipulate and create tables instead of QLik-language.

Labels (2)
2 Replies
Highlighted
MVP
MVP

Re: Create temporary table in SQL and insert values doesn't work in QLIikSense

Most of this script looks OK to me, but I am not sure that Qliksense can use the two result sets returned. For testing, I would remove the second select * and see if QS get that data from a single select. I that works, then concatenate the two temp tables in the SQL select expression. 

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Highlighted
MVP
MVP

Re: Create temporary table in SQL and insert values doesn't work in QLIikSense

I am of course assuming that the SQL syntax is correct for the DBMS. I would test the script in a query test tool (like SMS for SQL server, Toad or other).
Logic will get you from a to b. Imagination will take you everywhere. - A Einstein