Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

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?

1 Solution

Accepted Solutions
Not applicable

Re: Exclude values in SQL query

Figured it out, through trial and error

Firm__c != '*ICAP*'

thanks for your help anyway guys! It got me there in the end

10 Replies
pokassov
Valued Contributor

Re: Exclude values in SQL query

Hello!

Wildmatch is QV's operator, not SQL.

Try this

load

     *

where wildmatch(...);

sql select ...;

MVP
MVP

Re: Exclude values in SQL query

Try

SQL SELECT Id,

  AccountId,

  Firm__c

FROM Contact

WHERE AccountId != NULL Firm__c NOT LIKE '%ICAP%';

Re: Exclude values in SQL query

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

Not applicable

Re: Exclude values in SQL query

I am loading from Salesforce, so it needs an SQL statement.

The statement works absolutely fine without the wildmatch bit

Re: Exclude values in SQL query

Hi,

try

Firm_c not like '%ICAP%'

Regards

Great dreamer's dreams never fulfilled, they are always transcended.

Re: Exclude values in SQL query

use this

SELECT Id,

  AccountId,

  Firm__c

FROM Contact

WHERE AccountId != NULL AND not Firm__c Like '%ICAP%'

Not applicable

Re: Exclude values in SQL query

you missed the AND out, but it didn't work anyway

got this error

ERROR at Row:19:Column:40 unexpected token: LIKE

Not applicable

Re: Exclude values in SQL query

What is the SQL equivalent?

Not applicable

Re: Exclude values in SQL query

didn't work

ERROR at Row:19:Column:39 unexpected token: LIKE

Community Browser