Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Laja29
Contributor
Contributor

Regular expression in Sense

Hi!

I need to extract specific text pattern from string field (Ticket ID). Ticket ID consists of four letters and four to five numbers. Letters are always the same, for example "TICC". The numbers vary.  Ticket ID can be anywhere positioned in the string field. Here is a couple of examples:

1. "This is the testing (TICC1234) part."

2. "TICC12262 Still testing."

3. "Have another example. TICC9990"

How to extract ticket id out from these examples?  Is regular expressions the only way or some other trick?  Thanks for your reply.

1 Solution

Accepted Solutions
martinpohl
Partner - Master
Partner - Master

with 

index(yourfield,'TICC') you will get the position of TICC so you can start a mid.

how about the lenght, 4 or 5 digit. Is the string then ended after or are there other letters or numbers?

mid(yourfield,index(yourfield,'TICC'),9) as Expression

Regards

View solution in original post

3 Replies
martinpohl
Partner - Master
Partner - Master

with 

index(yourfield,'TICC') you will get the position of TICC so you can start a mid.

how about the lenght, 4 or 5 digit. Is the string then ended after or are there other letters or numbers?

mid(yourfield,index(yourfield,'TICC'),9) as Expression

Regards

jyothish8807
Master II
Master II

Hi,

May be this:

='TICC' & KeepChar(subfield(Mid( [Ticket ID],index([Ticket ID],'TICC')),' ',1),'.0123456789')

Br,

KC

Best Regards,
KC
Laja29
Contributor
Contributor
Author

Hi,

 

This works well. Thank you very much!