Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

EXISTS FUNCTION

Hi everyone:

I found a code like the following:

LOAD campo1 as MI_CAMPO,

          campo1 as CAMPO_CLAVE,

          campo1 as CLAVE_TABLA3,

          ............

FROM TABLE

WHERE Exists(MI_CAMPO,campo1));

And I do not understand it was intended to do because it is the first time you load the "TABLE" table in the system. Could someone knows why it would be interesting to do this?

Thanks in advance,

Regards

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi Enriqueta,

This function is used to limit the number of rows that are loaded based on previous loaded data. If you wanted to load certain rows in a dimension table and limit to just ones that you need based on another field, this is very helpful.

This is straight from the help guide:

exists(IDnr, IDnr) returns -1 (true) if the value of the field IDnr in the current record already exists in any previously read record containing that field.

Hope this helps!

View solution in original post

2 Replies
Anonymous
Not applicable
Author

Hi Enriqueta,

This function is used to limit the number of rows that are loaded based on previous loaded data. If you wanted to load certain rows in a dimension table and limit to just ones that you need based on another field, this is very helpful.

This is straight from the help guide:

exists(IDnr, IDnr) returns -1 (true) if the value of the field IDnr in the current record already exists in any previously read record containing that field.

Hope this helps!

Anonymous
Not applicable
Author

The script tells me that there is the field MI_CAMPO in a previously loaded data, no matter what table.  And the load in your example loads only the rows where values in campo1 match values in the previously loaded MI_CAMPO.