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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

check if a field contains an integer or something else with tFilterRow


Hello,

I would like to check in the tFilterRow advanced mode if the ID (integer) field of my csv file contains a value different from an integer or not. The objective is to reject lines in which this ID field is empty or contains a string or a character ... But I do not know how to do it. Here is an example of my file:

 

id ,name,etat
18209,COLLECTIVITE LOCALE,ACT
18210,836,DEGROUPAGE,2,ACT
,836,DEG,2,ACT
wsadza,GLOBECAST,ACT
836,TRANSPAC,ACT

 

Here is what I tried but that does not reject the empty values ​​and others

input_row.ID%input_row.ID != 0

 

Thank you for your attention

Labels (3)
1 Solution

Accepted Solutions
akumar2301
Specialist II
Specialist II

Remove "Die on Error" option in tFileInputDelimited .

 

You will have option to link rejects to a file.

View solution in original post

5 Replies
akumar2301
Specialist II
Specialist II

input_row.ID != null  && input_row.ID.matches("\\d+")

 

Anonymous
Not applicable
Author

Hello,

Thank's for your answer but I have this error : 

"The method matches(String) is undefined for the type Integer"

Indeed the field ID is of type integer and I do not want anything other than an integer.
 

akumar2301
Specialist II
Specialist II

In this case , record will be rejected by tFileInputDelimier itself ( if it
is Integer and data is String) also you can make this field not nullable in
schema definition.

so Null value records will also get rejected.


Anonymous
Not applicable
Author

Great Abhishek,

Since I want to redirect the rejected lines to a file, how can I do it? I was thinking of tFilterRow but that's not the case.

thank you in advance

akumar2301
Specialist II
Specialist II

Remove "Die on Error" option in tFileInputDelimited .

 

You will have option to link rejects to a file.