Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Join & exclude

Hi Experts

I have 2 Tables. One Field contains a lot of data. therefore I would like to load only port of the data. Thus I joined the tables to exclude part of the data:

Text:

SQL SELECT

txtnr,

memofeld

FROM EASY.texte;

Notiz:

left Join (Text)

SQL SELECT

  notnr,

art,

thema,

notiz_typ,

txtnr

FROM EASY.notiz where notiz_typ is = 258;

Problem is, "memofeld" is still loaded completely with 1 Mio datasets. I would only like to load entries where notiz_typ is = 258.

Anybody know a solution?

Thank you for your help!

Jan

Tags (1)
9 Replies

Re: Join & exclude

Hi,

try like,

Text:

SQL SELECT

  notnr,

art,

thema,

notiz_typ,

txtnr

FROM EASY.notiz where notiz_typ is = 258;

left join

SQL SELECT

txtnr,

memofeld

FROM EASY.texte;

Regards

Regards,
Prashant Sangle
Not applicable

Re: Join & exclude

Hm, that one does not work yet...

MVP
MVP

Re: Join & exclude

Hi,

Use inner join

Text:

SQL SELECT

txtnr,

memofeld

FROM EASY.texte;

Notiz:

Inner Join (Text)

SQL SELECT

  notnr,

art,

thema,

notiz_typ,

txtnr

FROM EASY.notiz where notiz_typ is = 258;

Regards,

Jagan.

anbu1984
Honored Contributor III

Re: Join & exclude

You can do the join in Sql

Text:

SQL SELECT

te.txtnr,

te.memofeld,

nz.notnr,

nz.art,

nz.thema,

nz.notiz_typ

FROM EASY.texte te, EASY.notiz nz

Where te.txtnr = nz.txtnr and nz.notiz_typ is = 258;

Or Use Inner join

Text:

SQL SELECT

txtnr,

memofeld

FROM EASY.texte;

Notiz:

Inner Join (Text)

SQL SELECT

  notnr,

art,

thema,

notiz_typ,

txtnr

FROM EASY.notiz where notiz_typ is = 258;

Not applicable

Re: Join & exclude

I like the inner join, but it does not work. I still load all datasets from memofeld...

pradeepreddy
Valued Contributor II

Re: Join & exclude

try the bellow scripts..

Option-1:

Notiz:

SQL SELECT

notnr,

art,

thema,

notiz_typ,

txtnr

FROM EASY.notiz where notiz_typ = '258';

Inner Join (Notiz)

Text:

SQL SELECT

txtnr,

memofeld

FROM EASY.texte;

anbu1984
Honored Contributor III

Re: Join & exclude

Check if you have spaces in field txtnr. You can also try inner join in Sql

Re: Join & exclude

Hi,

Did is = work properly?

just try with =

Text:

SQL SELECT

  notnr,

art,

thema,

notiz_typ,

txtnr

FROM EASY.notiz where notiz_typ = '258';         

left join

SQL SELECT

txtnr,

memofeld

FROM EASY.texte;

Regards

Regards,
Prashant Sangle
Not applicable

Re: Join & exclude

Hi,

Try this as per below example...

SoDetails:

LOAD

VBELN AS SalesOrder,

POSNR AS SalesOrderItem,

GBSTA AS SalesOrderStatus,

KUNNR AS SalesOrderCustomer;

SQL SELECT VBUP~VBELN, VBUP~POSNR, VBUP~GBSTA, VBAK~KUNNR FROM

VBUP LEFT JOIN VBAK ON VBUP~VBELN = VBAK~VBELN

WHERE VBUP~GBSTA = 'A';

Community Browser