Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

qlikviewalex
New Contributor III

Load if not equal

Hello,

I have a problem with my Skripting.

I join two Tables to one.

But I want only the elements, where the [Object-ID] is not included in Table1


Aufgaben:

LOAD [Object-ID],

     a,

b

FROM

[..\10_Data\test.xlsx]

(ooxml, embedded labels, table is Aufgaben);

join load distinct

[Object-ID],

   a,

b

FROM

[..\30_QVDs\Aufgaben.qvd] where ...............

(qvd);

I hope someone can help me.


Alex

Tags (2)
1 Solution

Accepted Solutions

Re: Load if not equal

Try this script it will work

Aufgaben:

LOAD [Object-ID],

     a,

b

FROM

Table1

(ooxml, embedded labels, table is Aufgaben);

[Object-ID],

   a,

b

FROM

table2

where not exists([Object-ID];

10 Replies
oknotsen
Honored Contributor III

Re: Load if not equal

Add this line of code:

where not exists([Object-ID]

to the 2nd load statement.

So the 2nd load statement turns into this:

join load distinct

[Object-ID],

   a,

b

FROM

[..\30_QVDs\Aufgaben.qvd]

where not exists([Object-ID]

(qvd);

May you live in interesting times!
qlikviewalex
New Contributor III

Re: Load if not equal

Unfortunately it does not work:

Script Error:


Error opening file '..\30_QVDs\Aufgaben.qvd where not exists  [Object-ID' The system cannot find the file specified.

join load distinct

[Object-ID],

    a,

b

FROM

[..\30_QVDs\Aufgaben.qvd] where not exists  [Object-ID]

(qvd);


Digvijay_Singh
Honored Contributor III

Re: Load if not equal

Are you sure you need join, all your field names in both the tables are same, you may want to use concatenate.

susovan_g
Valued Contributor

Re: Load if not equal

Hi,

You can also try this script,

Table1:

LOAD [Object-ID],

     a,

b

FROM

[..\10_Data\test.xlsx]

(ooxml, embedded labels, table is Aufgaben);

Concatenate

Table2:

LOAD [Object-ID],

   a,

b

FROM

[..\30_QVDs\Aufgaben.qvd] where ...............

(qvd);

Re: Load if not equal

Try like this

Aufgaben:

LOAD [Object-ID],

     a,

b

FROM

[..\10_Data\test.xlsx]

(ooxml, embedded labels, table is Aufgaben);

[Object-ID],

   a,

b

FROM

[..\30_QVDs\Aufgaben.qvd]

where not exists([Object-ID];


// since both the tables have similar columns it will automatically gets concatenated

qlikviewalex
New Contributor III

Re: Load if not equal

Thanks. You are all right. But my problem is not to connect the two tables.

I like only the elements where the Object-ID is NOT in the first Table.

Example:

Table1

Object-IDab

1

aa
2bb
3cc
4dd
5ee

Table2

Object-IDab
2xy
7gg
1attt

the result should look like this:


Object-IDab

1

aa
2bb
3cc
4dd
5ee
7gg


oknotsen
Honored Contributor III

Re: Load if not equal

join load distinct

[Object-ID],

   a,

b

FROM

[..\30_QVDs\Aufgaben.qvd]

(qvd)

where not exists([Object-ID])

;

May you live in interesting times!

Re: Load if not equal

Try this script it will work

Aufgaben:

LOAD [Object-ID],

     a,

b

FROM

Table1

(ooxml, embedded labels, table is Aufgaben);

[Object-ID],

   a,

b

FROM

table2

where not exists([Object-ID];

oknotsen
Honored Contributor III

Re: Load if not equal

Question:

Do you want to JOIN or CONCATENATE?

May you live in interesting times!
Community Browser