Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
ruben_moya
Creator
Creator

Doubt using Exists() function

Dear experts,

I've started using qvd files as a source of data in script and I have a question. 

So in the first part of the function you refer to a field that has been already loaded in the script. But, what if that field appears with the same name in different tables? which one does the function use? the last one?Do I have to specify which table am I referring to?

What I've been doing is to duplicate the field and rename it to make sure I am using the correct one.

 

Thanks in advance!

 

1 Solution

Accepted Solutions
marcus_sommer

Exists() refers to the distinct values of the field regardless in which tables the field occur.

Therefore the order in which the data are loaded is important. Beside the already mentioned method of dropping unwanted tables/fields and loading them if necessary later from a qvd again you may also create some additionally fields, like:

...
KEY as KeyForExists
...

to refer only to a certain subset of KEY values. Another approach could be to rename your fields back and forth on the outside from a load.

Beyond that very powerful exists-stuff it's always helpful to control the order of loadings explicitly.

- Marcus

View solution in original post

3 Replies
Ksrinivasan
Specialist
Specialist

Hi, 

you can use Drop Table function to separate those tables,

Regards,

KSrinivasan

marcus_sommer

Exists() refers to the distinct values of the field regardless in which tables the field occur.

Therefore the order in which the data are loaded is important. Beside the already mentioned method of dropping unwanted tables/fields and loading them if necessary later from a qvd again you may also create some additionally fields, like:

...
KEY as KeyForExists
...

to refer only to a certain subset of KEY values. Another approach could be to rename your fields back and forth on the outside from a load.

Beyond that very powerful exists-stuff it's always helpful to control the order of loadings explicitly.

- Marcus

ruben_moya
Creator
Creator
Author

Thanks a lot Marcus and KSrinivasan. I think the best option in my case will be to duplicate those fields and rename them. I need the tables so dropping them doesn't seem to be the best option for me.

Thanks once again!