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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Contains Matching?

Hi. I'm pretty new to Talend and looking to do the following:

 

I have a list of filename gathered from the directory using a tFileList and outputted to a MSSQL DB table called "Reports"

e.g.

 

ID | FileName

1  | ABC_000_ACC12345_Rep1.pdf

2  | DE_ACC35345_Rep2.pdf

3  | DE_123_ACC12345_Report.pdf

 

etc

 

I then have a mapping file which has client IDs and Account Numbers in it.  I have outputted this to another SQL table called "Accounts"

 

e.g.

 

ID | Name       | AccountNumber

1  | Joe Bloggs | ACC12345

2  | John Doe   | ACC35345

 

What I need is to join the reports from the "Reports" table, to the relevant account from the "Accounts" table by looking for the "AccountNumber" in the filename strings from the "Reports" table.

 

With the examples shown above, my aim is to get a final output like this:

 

ReportID | ClientID | AccountNumber | Filename

1        | 1        | ACC12345      | ABC_000_ACC12345_Rep1.pdf

2        | 2        | ACC35345      | DE_ACC35345_Rep2.pdf

3        | 1        | ACC12345      | DE_123_ACC12345_Report.pdf

 

Does Talend have any functions etc that can use one set of data almost as a contains match lookup?  Is anybody able to help?  

 

Steve

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi,

 

   Please refer the screenshot below.

0683p000009M7pQ.png

 

0683p000009M7nu.png

 

Please note that while using contain function, you need to make sure that you are trimming all the extra spaces while reading the data from file (By selecting tFileInputDelimited -> Advanced settings-> Trim all columns

 

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

4 Replies
lizzy1
Contributor III
Contributor III

Use a filter expression in your TMap with the java function String.contains()

Anonymous
Not applicable
Author

Hi,

 

   Please refer the screenshot below.

0683p000009M7pQ.png

 

0683p000009M7nu.png

 

Please note that while using contain function, you need to make sure that you are trimming all the extra spaces while reading the data from file (By selecting tFileInputDelimited -> Advanced settings-> Trim all columns

 

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

Thanks Nikhil, that's great. Very much appreciated.  Being a SQL developer and not a Java developer, and being new to Talend, I am getting there... slowly 0683p000009MACJ.png

 

I've now got my job to work as I want it 

Anonymous
Not applicable
Author

@abouzigon 

 

No worries. If you ask my background, I also started my professional journey from Oracle SQL 🙂 

 

So its just a matter of time before you also become a master in Talend!

 

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