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: 
Not applicable

DB SQL inside QV script

HI,

I am having new and interesting requirement.

"Select * from msd.emp where empid>10 " this is the sql and i want to use the same sql in Qlikview Script editor.

Instead of fetching the table how to use this SQL script inside the Qlikview Script editor??

1 Solution

Accepted Solutions
maxgro
MVP
MVP

just add the name of qlikview table and the sql prefix to your statement  in the script editor

qlikviewtable:

sql

Select * from msd.emp where empid>10

;

View solution in original post

4 Replies
Not applicable
Author

Hi,

you can do this :

NAMEOFTABLE:

LOAD ID AS [FIELD], ...

SQL SELECT ID,... FROM Table;

Regards;

Benjamin

jaimeaguilar
Partner - Specialist II
Partner - Specialist II

Hi,

Within QlikView, you can combine SQL script with QlikView Script. A typical script combining both kinds of script would be like this:

Table:

Load *; //1

SQL Select * from msd.emp where empid>10;   //2

//1. This is called preceding load. this part is what qlikview does after receiving the SQL script. Here you can either fetch the same data or narrow your extraction

//2. THE SQL statement indicates that everything after this will be sent to the database and therefore executed there. The final result wil be received by QlikView where you can manage it depending on your needs.


so this script executes from bottom to top,


regards


maxgro
MVP
MVP

just add the name of qlikview table and the sql prefix to your statement  in the script editor

qlikviewtable:

sql

Select * from msd.emp where empid>10

;

Not applicable
Author

Massimo Grossi,

Thanks for your reply and it works absolutely fine.