Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
leonardo_souza
New Contributor

Create Table with qlik script

Hi guys,

I'm new in Qlik script, and I'm having problems creating a table using qlik, let me try to explain... i want to do this  (SQL)  but on qlik

CREATE TABLE <TABLE_NAME>(

                    userid INT,

                    userfunction VARCHAR(15),

                    courseid INT,

                    courseactive VARCHAR(1),

                    disciplineidINT,

                    datevent VARCHAR(8),

                    usedtime INT

                    );


I think that I should use the LOAD statement, but i can't figure it out how

1 Solution

Accepted Solutions
zebhashmi
Valued Contributor

Re: Create Table with qlik script

Hi this will not work in Qlik

You can use

INLINE load with headers and data.

7 Replies
william_fu
Contributor II

Re: Create Table with qlik script

Do you want to create a table with just the headers?

If so, you can use something like this (no need to declare data types)

[TableName]:

LOAD * INLINE

[

    userid, userfunction, courseid ...       

];

If you're loading from an existing source, it would be something like this:

[TableName]:

LOAD

userid,

userfunction,

...

FROM [DataSource]

Partner
Partner

Re: Create Table with qlik script

<TABLE_NAME>:

LOAD

userid

, userfunction

, courseid

, courseactive

, disciplineid

, datevent

, usedtime

Inline

[

1, userfunction, 1,  1, 101, 2018/10/10, 100

];

zebhashmi
Valued Contributor

Re: Create Table with qlik script

Hi this will not work in Qlik

You can use

INLINE load with headers and data.

leonardo_souza
New Contributor

Re: Create Table with qlik script

i'm using an ODBC connection to connect to my database, the goal is to create a temporary table with the columns i mentioned,then i will do some joins and filters to finnaly have a report about the past month

leonardo_souza
New Contributor

Re: Create Table with qlik script

I spent all day searching and found nothing saying it would work, I think you're right ... unfortunately it won't work

Partner
Partner

Re: Create Table with qlik script

Another option.

<TABLE_NAME>:

LOAD

userid

, userfunction

, courseid

, courseactive

, disciplineid

, datevent

, usedtime

SELECT

userid

, userfunction

, courseid

, courseactive

, disciplineid

, datevent

, usedtime

FROM SQL Connection....

leonardo_souza
New Contributor

Re: Create Table with qlik script

thanks for the support guys, but I'm convinced that what I want to do it's not possible at Qlik


but thanks again