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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

find a value from table in a csv

I am new to Talend and I want to know how I can iterate through a file and compare a value with a table.

Suppose I want to check if a driver has how many fines.

Table Driver: ID, d_license, name 

Sample data:

1, 54B43D, John Smith

2,343d23F, Jane Do

3, 567S4R, Sharlot J.

 

Fine.csv: fine_id, name, fine

Sample data:

42, Jane Do, 54$

23, John Smith, 43$

54, Jane Do, 17$

 

Desired output:

ID, driver license, Name, fines(how many), Total

1, 54B43D,    John Smith, 1, 43

2,343d23F,      Jane Do,  2 , 54+17

3, 567S4R,     Sharlot J.,0,0

 

Labels (3)
1 Reply
Anonymous
Not applicable
Author

Hi,

 

    Please refer the screenshots for overall flow and component details.

0683p000009M5Wk.png

 

Driver details will be the main flow and fine file will be the lookup flow. The first step is to remove $ value from fine file.

0683p000009M6CQ.png

 

row2.fine.replaceAll("\\$","") 

Then convert the fine value from String to integer.

0683p000009M6CV.png

 

The next stage is to do all Match for the fine lookup data with driver main flow and join them using tMap.

0683p000009M60Q.png

 

Now, do the group by and add two new columns to do the count and sum. You will get desired output from the output connection of this component.

0683p000009M5ql.png

 

The name of all components are available in screenshots themselves. Please spare a second to mark the topic as resolved.

 

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 🙂