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

Where not exist issue

Need help with where not exist issue.

My SR from TableA is not getting removed because in the data itself there are spaces example "SR123    ", which QV couldn't read it and remove them.

I'm able to remove those spaces with below but where not exist doesn't work due to the spaces
KeepChar([SR], ' qazwsxedcrfvtgbyhnujmikolpABCDEFGHIJKLMNWOPQRSTUVXYZ1234567890-') AS [SR],

 

Any idea how to resolve this?

TableA:
Load [SR] as [SR A]

From

Downloads.......xxxx.xlsx;

 

TableB:

Load [SR No] as [SR No]

From
Downloads......DDDD.xlsx;
Where not exists([SR],[SR No]);

DropTableA:

 

1 Solution

Accepted Solutions
marcus_sommer

If you rename SR you need to refer to the new fieldname like:

... Where not exists([SR_A],[SR No]);

Further if both of your files contain these undefined chars you may skip your keepchar() approach or you need to apply it on both sides like:

... Where not exists([SR_A],KeepChar([SR No], ' qazwsxedcrfvtgbyhnujmikolpABCDEFGHIJKLMNWOPQRSTUVXYZ1234567890-'));

Beside this exists() refers to fieldvalues of a field not only to fieldvalues within a table - means any other loads before or in-between your mentioned loads which contain these fields (origin or renamed) will impact the results.

- Marcus 

View solution in original post

5 Replies
Taoufiq_Zarra

@Novelchew  can you share a sample data ?

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Chanty4u
MVP
MVP

can you share the excel?

which values you want to remove exactly?

and what is expected output should be

marcus_sommer

If you rename SR you need to refer to the new fieldname like:

... Where not exists([SR_A],[SR No]);

Further if both of your files contain these undefined chars you may skip your keepchar() approach or you need to apply it on both sides like:

... Where not exists([SR_A],KeepChar([SR No], ' qazwsxedcrfvtgbyhnujmikolpABCDEFGHIJKLMNWOPQRSTUVXYZ1234567890-'));

Beside this exists() refers to fieldvalues of a field not only to fieldvalues within a table - means any other loads before or in-between your mentioned loads which contain these fields (origin or renamed) will impact the results.

- Marcus 

QFabian
Specialist III
Specialist III

hi, try to use trim function , example : 

TableA:
Load [SR] as [SR A]

From

Downloads.......xxxx.xlsx;

 

TableB:

Load trim([SR No]) as [SR No]

From
Downloads......DDDD.xlsx;
Where not exists([SR A],trim([SR No]));

DropTableA:

QFabian
Novelchew
Contributor II
Contributor II
Author

Hi all!

Thanks for the help! 
Managed to resolve this with Marcus's help!

If you rename SR you need to refer to the new fieldname like:

... Where not exists([SR_A],[SR No]);

Further if both of your files contain these undefined chars you may skip your keepchar() approach or you need to apply it on both sides like:

... Where not exists([SR_A],KeepChar([SR No], ' qazwsxedcrfvtgbyhnujmikolpABCDEFGHIJKLMNWOPQRSTUVXYZ1234567890-'));

Beside this exists() refers to fieldvalues of a field not only to fieldvalues within a table - means any other loads before or in-between your mentioned loads which contain these fields (origin or renamed) will impact the results.

- Marcus