Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ananyaghosh
Creator III
Creator III

How to use exists()

Hello Firends,

I have created the following scripts, but does not get any reults:

1:

LOAD * INLINE [

   ids

    1

    2

    3

    4

    5

    6,

    10,

    19

];

table2:

LOAD * INLINE [

    id, flag

    1, 1

    2, 1

    3, 1

    4, 1

    5, 1

    6, 1

    7, 2

    7, 1

    7, 3

];

QUALIFY *;

table3:

LOAD * resident table2 where exists(id);

Now i want that table 1 and table1 's common values will be loaded.

What should I do now?

5 Replies
Not applicable

Hi,

You can try like this without loading a table3:

table2:

LOAD * INLINE [

    id, flag

    1, 1

    2, 1

    3, 1

    4, 1

    5, 1

    6, 1

    7, 2

    7, 1

    7, 3

]

Where Exists(ids, id);

Depending on your need and scenario, you may actually want to join both of tables, or link them by renaming id to ids in table2 (in which case you won't need to provide a second parameter for the exists function: "where exists(ids)").

terezagr
Partner - Creator III
Partner - Creator III

First of all you have an error in your 1 Load * Inline syntax - you have comas after 6 and 10 without having these enclosed in "" (in case the comas are supposed to be there). In case the comas are not supposed to be there, delete them.

1:

LOAD * INLINE [

   ids

    1

    2

    3

    4

    5

    "6,"

    "10,"

    19

];

or if comas are not supposed to be there:

1:

LOAD * INLINE [

   ids

    1

    2

    3

    4

    5

    6

    10

    19

];

Also, if you want to link table 1 and table2 you need to rename ids to id in your table 1.

Use the script below to do so:

1:

LOAD * INLINE [

   id

    1

    2

    3

    4

    5

    6

    10

    19

];

table2:

LOAD * INLINE [

    id, flag

    1, 1

    2, 1

    3, 1

    4, 1

    5, 1

    6, 1

    7, 2

    7, 1

    7, 3

];

QUALIFY *;

table3:

LOAD * resident table2 where exists(id);

You should now be presented with this:

Screen Shot 2015-02-15 at 11.00.16.png

ananyaghosh
Creator III
Creator III
Author

If I does not use QUALIFY *; what will happen that means what is the use of QUALIFY *; here?

Not applicable

If you will not use Qualify then you need to alise all fields from new table to avoid that & also to avoid synthetic key ..So better to use Qualify ..

saradhi_it
Creator II
Creator II

Hi Sandip,

the qualify and unqualify are important functions in qlikview the important thing while you are using qualify  in the syntax while you must use unqualify at the end of the script else the database crash occurs...