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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Filter Row if value is integer

 Hello,

 

I have an excel input in the below format: And I need to filter out whatever is non integer. 

ProjectNumber TaskNumber
107 AT
108 AT
108 C-NON
109 119
109 120
109 121
109 122
109 123
109 124
109 AT
109 C-NON
12518-1 AT
12518-1 C-NONSCA

 

I need the output as below:

ProjectNumber TaskNumber
109 119
109 120
109 121
109 122
109 123
109 124

 

Can anyone please suggest any solution. 

 

Thanks

SK

Labels (2)
1 Solution

Accepted Solutions
akumar2301
Specialist II
Specialist II

 

1) if you define your schema as Integer , it will reject non-numeric as Input level itself. ( un-tick "Die of error")

2) if you want to read as String and then check it can be done using regex also ( if you do not want to use external  library ) .One option other than tMap could be tFilterRow.

 

0683p000009M3hL.jpg

 

0683p000009M3WF.jpg

View solution in original post

4 Replies
Anonymous
Not applicable
Author

Hi,

 

    I believe you are looking for this solution.

0683p000009M3gh.png

 

0683p000009M3gm.png

 

The component details are as below.

 

You will have to download the jar commons-lang-2.2.jar to use the class NumberUtils. This can be achieved through tLibrarayLoad.

0683p000009M3gr.png

 

0683p000009M3h1.png

 

Now, use a tMap to separate the data based on the condition as shown below.

0683p000009M3hB.png

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

Anonymous
Not applicable
Author

Hi Nikhil,

Thank you so much for the quick response. Really appreciate it. Should I download the jar from talend studio (Help->Download additional packages) or should I install it externally ?

 

Also after I open the component I see the following options. Will be really grateful if you could guide me through this.

 

0683p000009M3hG.jpg

akumar2301
Specialist II
Specialist II

 

1) if you define your schema as Integer , it will reject non-numeric as Input level itself. ( un-tick "Die of error")

2) if you want to read as String and then check it can be done using regex also ( if you do not want to use external  library ) .One option other than tMap could be tFilterRow.

 

0683p000009M3hL.jpg

 

0683p000009M3WF.jpg

Anonymous
Not applicable
Author

Thank you Abhishek.. worked well..