Welcome Guest, you are in: Login

QVSource: The QlikView & Qlik Sense API Connector (Docs)

The Text Analytics & Sentiment Analysis Connector in version 1.5.2.7 of QVSource and later contains a new RegEx option which allows you to run high performace RegEx find and replace operations from your QlikView and Qlik Sense load scripts.

Table of Contents [Hide/Show]


Usage

At time of writing this allows you to:
  • Find all instances of a regular expression matched in a text field in your QlikView model.
  • Replace all instances of a regular expression matched in a text field (with a text you supply) as your QlikView load script runs.

This is a relatively new feature and we are keen to get your feedback as to what you would like to be able to achieve in your QlikView load scripts with respect to regular expressions.

SimpleMatch

The SimpleMatch table allows you to find all matches of a regular expression in the text supplied.

Image

The following is a simple example which uses the regular expression from this post to search through all the ZenDesk tickets created by this demo application for any URLs mentioned.

This could be useful, for example, to see which web pages are being referenced most by customers looking for support or agents answering support requests.


Tickets:
load 
* from 
QVDs\ZenDesk_Tickets.qvd (qvd);

Params:
load
'RegEx' as api,
'((http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?)' as regEx,
ZenDesk_Ticket_id as rowKey,
ZenDesk_Ticket_description as text
resident Tickets;

store Params into params.txt (txt);

TextAnalyserV2_SimpleFind:
LOAD
	rowKey as ZenDesk_Ticket_id,
	Match as SimpleFind_Match,
	Index as SimpleFind_Index,
	Length as SimpleFind_Length
FROM
[http://localhost:5555/QVSource/TextAnalyserV2/?table=SimpleMatch&appID=&processParamsSync=PATH_TO_QVW_FILE_HERE\params.txt]
(qvx);

Note: This example uses the sync/async/batch feature explained here to first save all the input parameters for multiple calls to the SimpleMatch table into a text file. This is particularly useful when processing text as there is no need to URL encoded the text before passing it to QVSource.

Replace

The Replace table allows you to replace all matches of a regular expression with a text you supply.

Image
  Name Size
- regex number look up.png 32.41 KB
- regex replace.png 30.85 KB


(QVSource works with Qlik Sense as well as QlikView - See this page for notes.)
QVSource - The QlikView & Qlik Sense API Connector | © Copyright 2011 - 2016 Industrial CodeBox Ltd