Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

asmithbi
Contributor II

Where Not WildMatch Not Working

Hello,

I have a load script below that I need to not include all names that start with 'ACCT' in the FirstName field.  The where clause below is not working and is failing the load script (see attached screen shot).

The where clause looks right based on multiple posts on this topic in the Community.  I'm not seeing where the issue is.  Has anyone dealt with this issue? 

Thank you in advance for any assistance.

Contacts:

LOAD LastName,

    FirstName,

    CompanyName,

    Telephone1,

    Telephone2,

    Email,

  AddressRecordNumber,

  IsPrimaryContact;

SQL SELECT *

FROM METLABCORPORATION.Contacts

WHERE Not WildMatch(FirstName,'ACCT*');

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: Where Not WildMatch Not Working

Marcus is right that you can only use Wildmatch in the LOAD statement.

It might be preferable to let the DBMS filter the records, so something like this should also work:

Contacts:

LOAD LastName,

    FirstName,

    CompanyName,

    Telephone1,

    Telephone2,

    Email,

  AddressRecordNumber,

  IsPrimaryContact;

SQL SELECT *

FROM METLABCORPORATION.Contacts

WHERE FirstName NOT LIKE 'ACCT%';

6 Replies
Not applicable

Re: Where Not WildMatch Not Working

Hi Alec,

If you are using a SQL statement, you should use LIKE instead of WildMatch:

WHERE FirstName NOT LIKE 'ACCT%'

Best regards,

Daniel

Re: Where Not WildMatch Not Working

The where condition with wildmatch() which is a qv-functions needs to applied to the preceeding-load:

Contacts:

LOAD LastName,

    FirstName,

    CompanyName,

    Telephone1,

    Telephone2,

    Email,

  AddressRecordNumber,

  IsPrimaryContact

WHERE Not WildMatch(FirstName,'ACCT*');

SQL SELECT *

FROM METLABCORPORATION.Contacts;

- Marcus

MVP
MVP

Re: Where Not WildMatch Not Working

Marcus is right that you can only use Wildmatch in the LOAD statement.

It might be preferable to let the DBMS filter the records, so something like this should also work:

Contacts:

LOAD LastName,

    FirstName,

    CompanyName,

    Telephone1,

    Telephone2,

    Email,

  AddressRecordNumber,

  IsPrimaryContact;

SQL SELECT *

FROM METLABCORPORATION.Contacts

WHERE FirstName NOT LIKE 'ACCT%';

asmithbi
Contributor II

Re: Where Not WildMatch Not Working

Thank you Marcus.  I won't make that mistake again

asmithbi
Contributor II

Re: Where Not WildMatch Not Working

Thank you swuehl.  That did the trick. 

asmithbi
Contributor II

Re: Where Not WildMatch Not Working

Thank you Daniel 

Community Browser