Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
Specialist
Specialist

Hi this will not work in Qlik

You can use

INLINE load with headers and data.

View solution in original post

7 Replies
william_fu
Creator II
Creator II

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]

nsetty
Partner - Creator II
Partner - Creator II

<TABLE_NAME>:

LOAD

userid

, userfunction

, courseid

, courseactive

, disciplineid

, datevent

, usedtime

Inline

[

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

];

zebhashmi
Specialist
Specialist

Hi this will not work in Qlik

You can use

INLINE load with headers and data.

Anonymous
Not applicable
Author

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

Anonymous
Not applicable
Author

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

nsetty
Partner - Creator II
Partner - Creator II

Another option.

<TABLE_NAME>:

LOAD

userid

, userfunction

, courseid

, courseactive

, disciplineid

, datevent

, usedtime

SELECT

userid

, userfunction

, courseid

, courseactive

, disciplineid

, datevent

, usedtime

FROM SQL Connection....

Anonymous
Not applicable
Author

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


but thanks again