Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
RomanVanK
Contributor II
Contributor II

How to load data that matches regular expression?

Trying to only load rows where URL matches regular expression ^domain\.com.

I solved it the way I did not want to with if(WildMatch([PageURL],'domain.com*'),'Yes','No') AS [MainDomain]- I would rather avoid creating a new column.

I Googled the living daylights of "qlik match regex in load" and its variations.

Below is another example of something that does not work:

LOAD
    DateOfPageview,
    PageURL,
    Pageviews
    FROM [lib://dataSource.qvd]
    WHERE [PageURL] REGEXP '^domain\.com'
(qvd);

Is it possible?

Thank you.

Labels (2)
3 Replies
Lisa_P
Employee
Employee

I'm not familiar with the regular expression syntax, but based on your expression that worked, you could do something similar in the load statement.
...
WHERE [PageURL] like "*domain.com*"
RomanVanK
Contributor II
Contributor II
Author

Your suggestions worked, thank you.

Here's the script that worked:

LOAD
    DateOfPageview,
    PageURL,
    Pageviews
FROM [lib://dataSource.qvd]
(qvd)
WHERE [PageURL] like 'domain.com*';

I cannot mark my original question as solved, because this is an answer to a different question.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

The "like" operator and the "Wildmatch()" function support wildcard characters "*" and "?".  It's good that you could resolve your particular requirement with like. 

Regular expression syntax is not currently supported in Qlik Sense out-of-the-box.  A couple of possible workarounds when you do need full regex:

1. Use the RegEx web connector https://help.qlik.com/en-US/connectors/Subsystems/Web_Connectors_help/Content/Connectors_QWC/Data-So...

2. Write your own (or borrow) your own RegEx implementation as a Server Side Extension. See https://github.com/RobWunderlich/qcb-qlik-sse

It would be great to see Regex function as native Qlik functions!

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com