Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Remco1
Contributor III
Contributor III

tFilterRow regex not working?

I'm using the advanced setting in tFilterRow (Open Studio 6.3). I've tried the following code (regex) to filter rows:

java.util.regex.Pattern.compile("\\d+").matcher(input_row.code).find()

java.util.regex.Pattern.compile("\\d*").matcher(input_row.code).find()

java.util.regex.Pattern.compile("[0-9]+").matcher(input_row.code).find()

java.util.regex.Pattern.compile("[0-9]*").matcher(input_row.code).find()

 

This should return only records where the value of "code" only exists out of digits (0-9), however it does return records with at least one digit and characters. Which regex should I use to return only digit values?

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

One last try for me
input_row.code.trim().matches("[0-9]+")

View solution in original post

10 Replies
Anonymous
Not applicable

Hi,

Could you please elaborate your case with an example with input and expected output values?

Best regards

Sabrina

Remco1
Contributor III
Contributor III
Author

Hello Sabrina,



Thnx for your reply, here's my case. It should only return rows that exists only out of digits (in schema this is column "code" that refers to column K "AUTHORISATIE" in the csv file). It now returns 303 out of 305 records because the value contains a digit, it should return only 40 records (eg in the csv file row K7 which has a value of 113577)



[cid:image002.png@01D34981.D6D5C8E0]



[cid:image004.jpg@01D34982.BA72D3E0]



[cid:image007.jpg@01D34982.BA72D3E0]



With regards,



Remco


Anonymous
Not applicable

Hello,

Actually, we cannot see your image from our side. Could you please check it?

Could you please  upload your Screenshots by click 'photos' icon on forum? Feel free to let us know if there is any problem for you.

Best regards

Sabrina

Remco1
Contributor III
Contributor III
Author

Hello Sabrina,

 

Here are the screenshots

 

0683p000009LrW0.png0683p000009LrO5.jpg0683p000009LrPa.jpg

 

Remco

Anonymous
Not applicable

Can you try any of below expressions?
java.util.regex.Pattern.compile("^[0-9]+").matcher(input_row.code).find()

Or
java.util.regex.Pattern.compile("^\\d+").matcher(input_row.code).find()
Remco1
Contributor III
Contributor III
Author

This doesn't work, it returns 0 records.



Thnx Remco


Anonymous
Not applicable

Sorry use matches() method instead of find()

java.util.regex.Pattern.compile("[0-9]+").matcher(input_row.code).matches()

Or
java.util.regex.Pattern.compile("\\d+").matcher(input_row.code).matches()
Remco1
Contributor III
Contributor III
Author

Also 0 records...



Remco


Anonymous
Not applicable

One last try for me
input_row.code.trim().matches("[0-9]+")