Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
Not applicable

WHAT IS OUTPUT FOR THIS

tab1:

LOAD * INLINE [

    F1, F2

    A, 1

    B, 2

    C, 3

    D, 4

];

tab2:

LOAD * INLINE [

    F3, F4

    A, AA

    B, BB

    C, CC

    E, EE

];

Table3:

LOAD

    *

RESIDENT tab2

WHERE   Exists(F1,F3);

//

//

drop table tab1;

drop table tab2;

1 Solution

Accepted Solutions
Highlighted
MVP
MVP

Re: WHAT IS OUTPUT FOR THIS

the result is nothing

if you want table 3 as result you must add a noconcatenate

Table3:

noconcatenate

LOAD

    *

RESIDENT tab2

WHERE   Exists(F1,F3);

View solution in original post

10 Replies
Highlighted

Re: WHAT IS OUTPUT FOR THIS

Lines with F3 = {A,B,C} and corresponding F4 values will exist in Table3;

Peter

Highlighted

Re: WHAT IS OUTPUT FOR THIS

But why don't you just run the script and open the table viewer? QlikView is the magical trial-and-maybe-but-you-never-know-error tool!

Peter

Highlighted
Not applicable

Re: WHAT IS OUTPUT FOR THIS

hi peter pls calrify me what is the difference between exists and not exists function

Highlighted

Re: WHAT IS OUTPUT FOR THIS

Of course, it may be that Table3 gets JOINed to tab2 and dropped in the end... Add NOCONCATENATE to the Table3 LOAD to be sure.

Peter

Highlighted
MVP
MVP

Re: WHAT IS OUTPUT FOR THIS

the result is nothing

if you want table 3 as result you must add a noconcatenate

Table3:

noconcatenate

LOAD

    *

RESIDENT tab2

WHERE   Exists(F1,F3);

View solution in original post

Highlighted

Re: WHAT IS OUTPUT FOR THIS

It's the same function: exists(). In the second case, you are logically negating the return value of exists(). NOT is a boolean operator that says that exists() should not return true.

...WHERE Not Exists(F1, F3);

means that each F3 value we are loading should NOT exist in field F1.

Peter

Highlighted
Not applicable

Re: WHAT IS OUTPUT FOR THIS

hi i want know how exist function work here can u pls explain me

Highlighted

Re: WHAT IS OUTPUT FOR THIS

For every row we load from table tab2, QlikView checks whether the value in column F3 exists in the existing QlikView field F1. It sort of acts like a lookup. If the value exists, the row will be stored in table Table3. Otherwise the row will be dropped.

Peter

Sorry, corrected naming error

Highlighted
Not applicable

Re: WHAT IS OUTPUT FOR THIS

thanks