Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Highlighted
Partner
Partner

How to work Regular Expressions in Qlik Sense?

Hello!

Has  anybody worked with Regular Expresions in Qlik Sense?, I already know 'RegEx' does not exist in Sense, nevertheless I need to evaluate the content of diferent dimensions into my data model, for instance:

Dimension: RFC

Content: CALE891013rr08

In order to create a flag , I need to evaluate the first 4 characters are capital letters, the next 6 characters are numbers, the next 2 are lower case  and the last 2 are numbers.

I´d really appreciate your help.

Thanks in advance.

8 Replies
Highlighted

Re: How to work Regular Expressions in Qlik Sense?

What is the issue here? May be look the use RegEx

Regular expression [A-Z] *

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
Partner
Partner

Re: How to work Regular Expressions in Qlik Sense?

Hello, thanks for answering, however is not what I need.

I already work using regular expressions in Qlik View, the issue is working them in QlikSense because in Qlik Sense does not exists RegEx and I have not found how to evaluate the content of my dimensions in Sense.

Highlighted

Re: How to work Regular Expressions in Qlik Sense?

True, I thought your initial group seems Qlikview. Anyway you may move this topic into Qliksense Branch

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
Partner
Partner

Re: How to work Regular Expressions in Qlik Sense?

I will, thanks for your time. Greetings

Highlighted
New Contributor

Re: How to work Regular Expressions in Qlik Sense?

Hi Araceli, maybe you can try this:

SET vFirst=1;
SET vSecond=5;

Do while vFirst<=4

Table:
Load
   RFC,
   if(ord(mid(RFC,$(vFirst),1))>= 65 and ord(mid(RFC,$(vFirst),1))<= 90,1,0) as Prove
resident MainTable;

//ord = code ascci, hence the search is from 65 to 90
//mid = returns the part of the string, in this case, letter by letter



Do while vSecond<=10

Tabla:
Load
   RFC,
   if(mid(RFC,$(vSecond),1)>= 0 and mid(RFC,$(vSecond),1)<= 9,1,0) as Prove2
resident MainTable;

//here the function ord is not necesary, and the search is between 0 and 9

At the end, you get 0 if one condition is not true, for example:

RFC                            Prove      Prove2
%DOG999999XXX          0          1
MEMM444444LLL            1          1
MEMM45M678KKK         1          0

I hope I've helped you

Highlighted
New Contributor

Re: How to work Regular Expressions in Qlik Sense?

Hi again Araceli.

I was thinking about your problem and my little solution too. I did many test with different cases,

and my solution it's wrong But I thought something simpler, only you need use several functions:


if(len(PurgeChar(mid(rfc,1,4),'_%&@()0123456789'))<4 or len(KeepChar(mid(rfc,5,6),'0123456789'))<6 or len(PurgeChar(mid(rfc,6,3),'_·$%&'))<3,0,1) as prove,


You get 0 if you have at leats a wrong character

Highlighted
Partner
Partner

Re: How to work Regular Expressions in Qlik Sense?

A bit late, but a RegEx connector is included in the Qlik Web Connectors package. I have tested it, and it validates the RFC as you need to.

https://help.qlik.com/en-US/connectors/Subsystems/Web_Connectors_help/Content/Data-Source-Connectors...

Highlighted
Partner
Partner

Re: How to work Regular Expressions in Qlik Sense?

Hello,

You can also vote for this idea.
https://community.qlik.com/t5/Qlik-Sense-Enterprise-Ideas/Native-Regex-support-for-Qlik-Sense/idi-p/...
Best regards,

Simon

Bi Consultant (Dataviz & Dataprep) @ Business & Decision