
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Exclude values in SQL query
So i have the below section in my script, as I am trying to exclude Firms with the name ICAP in. But my wildmatch function doesn't seem to work. Is wildmatch the best way of doing this?
SQL SELECT Id,
AccountId,
Firm__c
FROM Contact
WHERE AccountId != NULL AND WILDMATCH(Firm__c, '*ICAP*')=0;
I have also tried this, which also does not work
SQL SELECT Id,
AccountId,
Firm__c
FROM Contact
WHERE AccountId != NULL AND NOT WILDMATCH(Firm__c, '*ICAP*');
What am I doing wrong?
- Tags:
- qlikview_scripting
- « Previous Replies
-
- 1
- 2
- Next Replies »
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Figured it out, through trial and error
Firm__c != '*ICAP*'
thanks for your help anyway guys! It got me there in the end


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello!
Wildmatch is QV's operator, not SQL.
Try this
load
*
where wildmatch(...);
sql select ...;


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try
SQL SELECT Id,
AccountId,
Firm__c
FROM Contact
WHERE AccountId != NULL Firm__c NOT LIKE '%ICAP%';


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wildmatch is a qlik function so you cannot use into a Select statement.
You could do
Load
...
Where WILDMATCH(Firm__c, '*ICAP*')=0;
Select
... (Your query)
otherwiseyou can use only SQL
doing:
SELECT Id,
AccountId,
Firm__c
FROM Contact
WHERE AccountId != NULL AND not Firm__c Like '%ICAP&';
let me know

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am loading from Salesforce, so it needs an SQL statement.
The statement works absolutely fine without the wildmatch bit

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
try
Firm_c not like '%ICAP%'
Regards
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
use this
SELECT Id,
AccountId,
Firm__c
FROM Contact
WHERE AccountId != NULL AND not Firm__c Like '%ICAP%'

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
you missed the AND out, but it didn't work anyway
got this error
ERROR at Row:19:Column:40 unexpected token: LIKE

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What is the SQL equivalent?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
didn't work
ERROR at Row:19:Column:39 unexpected token: LIKE

- « Previous Replies
-
- 1
- 2
- Next Replies »