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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
jolio007
Contributor
Contributor

Finding keywords in a tabel

Hello,

 

I'm new working with Talend so bear with me if I'm asking something ridiculous.
I have a 2 Excel Files. One with all the data and the other that has only one column. In the one with one column, I have key words. The goal is to look into the excel with all the data if a row contain the key words then if it does output a "Yes" in one column.
I have used a tJava to extract the keywords and I was told I could use a tMap but I'm not sure what the configuration would be .

Labels (4)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi,

 

    Please refer the screen shots below for the flow.

0683p000009M3Jn.png

 

The first job will be used to find the matching conditions. For all the tfileInputDelimited components, select Trim columns option (advanced section) and use Pipe as the column delimiter. 

 

In the first tMap, you will do a all row match as shown in diagram below.

0683p000009M3JP.png

 

The function to be used in output filter condition is as shown below.

 

row1.Label.toLowerCase().contains(row2.colour.toLowerCase() )

The output will be stored to csv file and the basic and advanced conditions are as shown below.

0683p000009M3B6.png

 

0683p000009M3Js.png

 

In the second subjob, you will pick only those records which are not present in previous file. The main flow will be the input file and the lookup flow will be the file generated in the first subjob.

0683p000009M3Jx.png

0683p000009M3K2.png

 

Hope I answered your query 🙂

 

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 🙂

 

View solution in original post

9 Replies
Anonymous
Not applicable

Hi,

 

   Could you please share a sample file for both input and Keyword so that we will get some idea about your use case?

 

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 🙂

jolio007
Contributor
Contributor
Author

I’m not near my computer right now, I shall send a proper file later, if needed but here how I looks roughly
————
Table 1
Label name | Category | Price | Accepted
Décathlon Yellow runners | trainers | 10 |
SpongeBob yellow bag | bag | 5 |
Ad runner black | trainer | 12 |
Red jumping rope | accessories | 15 |
————
Table 2
Colour accepted
Yellow
Red
————
Then have a value in the accepted column if the values in table 2 are found in the line.

Anonymous
Not applicable

Hi,

 

    Please refer the screen shots below for the flow.

0683p000009M3Jn.png

 

The first job will be used to find the matching conditions. For all the tfileInputDelimited components, select Trim columns option (advanced section) and use Pipe as the column delimiter. 

 

In the first tMap, you will do a all row match as shown in diagram below.

0683p000009M3JP.png

 

The function to be used in output filter condition is as shown below.

 

row1.Label.toLowerCase().contains(row2.colour.toLowerCase() )

The output will be stored to csv file and the basic and advanced conditions are as shown below.

0683p000009M3B6.png

 

0683p000009M3Js.png

 

In the second subjob, you will pick only those records which are not present in previous file. The main flow will be the input file and the lookup flow will be the file generated in the first subjob.

0683p000009M3Jx.png

0683p000009M3K2.png

 

Hope I answered your query 🙂

 

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 🙂

 

manodwhb
Champion II
Champion II

@jolio007 ,you need to do the inner join with tMap or tjoin to match the record to get from single column file.

 

find the below links will help you to do inner join.

https://help.talend.com/reader/0DkFceSqOPXOhdoAY6uLQA/PXagRwiqRo5ZV0D3Ab60Mw

https://help.talend.com/reader/mjoDghHoMPI0yuyZ83a13Q/7VFow3bHpC71W~iGA3oYnA

jolio007
Contributor
Contributor
Author


 the lookup flow will be the file generated in the first subjob.

 


When I try to use the file generated in the subjob, I get an error - the file specified cannot be found 

Anonymous
Not applicable

@jolio007 

 

Could you please share the screen shots of your jobs and individual component screen shots like in my post above?

 

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 🙂

jolio007
Contributor
Contributor
Author

0683p000009M2in.pnghere's the overal picture.
tFileInputExcel_1 is the input of the tFileOutputExcel_1. 
With the tMap_7, I want to get the items that were rejected by the tMap_2. But it gives me the same thing as the tFileOutputDelimited_1
0683p000009M2Un.png0683p000009M2nN.pnghere you can see my setting in the tMap_7. 

jolio007
Contributor
Contributor
Author

I found the solution. All I needed to do was set the "Catch lookup inner join reject" as true
Anonymous
Not applicable

@jolio007 

 

Very good. It is always a happy moment when you find the solution yourself 🙂

 

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 🙂