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

Script Wildcard not working as expected

I am trying to eliminate unwanted junk data from my list box views so I added the command to the script.  It is not working so I'm asking for some feedback on what is the correct way to do this.

Here is the junk I'm trying to eliminate:

And here are the commands:

FROM "DW_LMKPSFT"."PSD_PS_XR_COMPANY"
WHERE BO_NAME <> 'ABCDE Guest' or BO_NAME <>'*OUT*' or BO_NAME <> '*DUP*';

Also:

SQL SELECT "CASE_CONTACT",
NAME as CONTACT_NAME
FROM "DW_LMKPSFT"."PS_XR_CONT_NAME_VW"
WHERE NAME <>'*??**' or NAME <>'*zzz**'
;

Any help is greatly appreciated!

1 Solution

Accepted Solutions
sunny_talwar

I think since you are using your where statement in SQL, you need to use SQL syntax here (SQL Wildcards). May be try this:

SQL SELECT "CASE_CONTACT",
NAME as CONTACT_NAME
FROM "DW_LMKPSFT"."PS_XR_CONT_NAME_VW"
WHERE NAME NOT LIKE '??%' or NAME NOT LIKE 'zzz%'
;

View solution in original post

10 Replies
sunny_talwar

I think since you are using your where statement in SQL, you need to use SQL syntax here (SQL Wildcards). May be try this:

SQL SELECT "CASE_CONTACT",
NAME as CONTACT_NAME
FROM "DW_LMKPSFT"."PS_XR_CONT_NAME_VW"
WHERE NAME NOT LIKE '??%' or NAME NOT LIKE 'zzz%'
;

Anil_Babu_Samineni

You can use PurgeChar(FieldName, '!@#$%^&*()_+') as FieldName

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author

This works for just the first item, so the "or" does not work for the next item. Any suggestions?

sunny_talwar

That is strange, i would have thought that this works. Can you test the sql outside of QlikView to see if it still doesn't work? Like in TOAD or whatever you use to run queries.

Not applicable
Author

I got it...thanks for your help!

sunny_talwar

Would you be able to point out what exactly worked for you? May be this might help someone else in the future also.

Thanks,

Sunny

Not applicable
Author

Sure...I used 'and' instead of 'or' and I removed the % sign from the beginning of the string (if there were no preceding characters ahead of the text I wanted to remove)

sunny_talwar

Ya, I did remove them from the start when I gave you, but did not think you would need and instead of or. But that is the sort of thing that always confuses me.

Anyways, I am glad it finally worked.

Best,

Sunny

Not applicable
Author

here is the command I ended up with that provides the desired data:

WHERE NAME NOT LIKE 'zz%' and NAME NOT LIKE '??%' and NAME NOT LIKE '(%'

and

WHERE BO_NAME NOT LIKE '%*%' and BO_NAME NOT LIKE 'ABCDE%'