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: 
Anonymous
Not applicable

Record counting

Hi!

 

I have a file of many lines, where the last column of the first row is equivalent to a number that is the total of the following lines, that is, if the number of that column is 1250, it means that there are 1250 lines after it.
How do you this in Talend?

 

Thanks! 

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi,

 

    We can do multiple ways in Talend.

 

    For example, you can send a copy of your data to taggregaterow with sum function to calculate the total rows. Or if the source is a DB, you can take the count from DB itself and store to a context variable. 

 

   Either way, once the total count is achieved, you can send them to a tfileoutputdelimited component with only header avlues and total count in tMap.

 

    Then you need to read the actual data and send them also to the same file but this time, you need to mark the append mode as selected (so that header data will be there).

 

    Since you have not shared the job flow screenshots or the sample data file, I will not be able to elaborate further. But these instructions should be sufficient for you to fix the problem. If you are stuck, please feel free to come back with above details and we are always here to help you 🙂

 

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

1 Reply
Anonymous
Not applicable
Author

Hi,

 

    We can do multiple ways in Talend.

 

    For example, you can send a copy of your data to taggregaterow with sum function to calculate the total rows. Or if the source is a DB, you can take the count from DB itself and store to a context variable. 

 

   Either way, once the total count is achieved, you can send them to a tfileoutputdelimited component with only header avlues and total count in tMap.

 

    Then you need to read the actual data and send them also to the same file but this time, you need to mark the append mode as selected (so that header data will be there).

 

    Since you have not shared the job flow screenshots or the sample data file, I will not be able to elaborate further. But these instructions should be sufficient for you to fix the problem. If you are stuck, please feel free to come back with above details and we are always here to help you 🙂

 

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 🙂