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

Where filter using like and wildcard

  I have a list of Business Units 10100000, 10200100, 10200150, 1040000, etc.

    

I want to pull data only for business units that start with 10200XXX.

    

If I use the code below and I do where WWBusUnit = "10200100" it
will return the WWCustomerIndustry for that one Business Unit. However if I try
to use a wild card, it does not return any WWCustomerIndustry records.

   

What is the appropriate syntax or method to do what I want?

    

LOAD WWBusUnit,
WWCustomerIndustry

FROM
WWCustomerIndustry.qvd
(
qvd)

Where
WWBusUnit Like '*10200*'

Tags (4)
1 Solution

Accepted Solutions
Not applicable

Re: Where filter using like and wildcard

Hi,

Try something like below:

LOAD BusinessUnit,

     Category

FROM

E:\qlikview\Source\wildcard_Demo.xlsx

(ooxml, embedded labels, table is Sheet1)

where BusinessUnit like '1020*';

4 Replies
Not applicable

Re: Where filter using like and wildcard

Hi,

Try something like below:

LOAD BusinessUnit,

     Category

FROM

E:\qlikview\Source\wildcard_Demo.xlsx

(ooxml, embedded labels, table is Sheet1)

where BusinessUnit like '1020*';

gabriel_kirst
Contributor III

Re: Where filter using like and wildcard

Hi!

To get everything that starts with 10200, you can use this:

Where WWBusUnit Like '10200*';


I believe that in this case like is the best way.


Regards,

Gabriel

Not applicable

Re: Where filter using like and wildcard

Yes that did it.  I can't believe I was that close but couldn't get it.  Appreciate the help

kimrormark
Contributor

Re: Where filter using like and wildcard

I would use; where wildmatch(BusinessUnit, '10200*');

Gives the same result, but might be more performant in some cases (e.g. large data sets)

Community Browser