Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

How do you add more than 1 table in the script editor ?

Example i have this SQL statement which i use to grab my data (and join 4 tables): SQL SELECT * FROM RAMBATHS.AULT2F2.ORDLNORD,RAMBATHS.AULT2F2.PARTS,RAMBATHS.AULT2F2.ORDHDORD,RAMBATHS.AULT2F2.OEP20 where cono40=cono55 and ordn40=ordn55 and cono55=cono35 and catn55=pnum35 and cono55='01' and cono40=cono20 and cusn40=cusn20 and dseq40=dseq20 and Stat55=' ' which is grabbing 4 tables. I need to grab about 30 tables. Or 10 at the least. How in the script editor do you definite more than 1 table when grabbing from an ODBC data source ? Ta Adam

1 Solution

Accepted Solutions
MVP
MVP

How do you add more than 1 table in the script editor ?

Hi Adam,

you have to specify the table name before the SQL SELECT in the script:

mytable1:

SQL SELECT..

mytable2:

SQL SELECT..

etc.

- Ralf

5 Replies
MVP
MVP

How do you add more than 1 table in the script editor ?

Hi Adam,

you have to specify the table name before the SQL SELECT in the script:

mytable1:

SQL SELECT..

mytable2:

SQL SELECT..

etc.

- Ralf

Not applicable

How do you add more than 1 table in the script editor ?

Excellent thank you Ralf looks like i need to get myself some SQL reading material

Not applicable

How do you add more than 1 table in the script editor ?

Ralf if it doesn't automatically pick up the join how do i make it join ?

SQL SELECT * FROM RAMBATHS.AULT2F2.ORDLNORD,RAMBATHS.AULT2F2.PARTS,RAMBATHS.AULT2F2.ORDHDORD,RAMBATHS.AULT2F2.OEP20
where cono40=cono55 and ordn40=ordn55 and cono55=cono35 and catn55=pnum35 and cono55='01' and cono40=cono20 and cusn40=cusn20 and dseq40=dseq20 and Stat55=' '
;

Warehouse:
SQL select * from rambaths.AULT2F2.WHP35

;
Description:
SQL select * from rambaths.aulsprx3.pgmj

Thats the select statements i have, but the file pgmj from the descriptions table has a field called PSAR15 which matches with PGMJ35 from the file PARTS. Because the fields arent the same name Qlikview didnt manage to match them so the file is orphaned. How do i match it ?

Kind Regards

Adam

MVP
MVP

How do you add more than 1 table in the script editor ?

Adam,

it's always better to select a column list instead of star (*). Then you also can use a column alias:

SQL SELECT PSAR15 as PGMJ35 ...

.. or vice versa.

- Ralf

Not applicable

How do you add more than 1 table in the script editor ?

Perfect. Thanks Ralf. I do have 1 last question but i'll slap it in another post

Community Browser