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

[resolved] tFileOutputExcel

Hallo,

I have the following scenario.
tMap -------> tFileOutputExcel_1
  |
  +---------> tFileOutputExcel_2

I want to write into the same Excel file, however, did not manage to do so. I only got the output of tFileOutputExcel_2. Even when trying to write to different sheets in the same Excel file, I had only the sheet of tFileOutputExcel_2 in it.
Is it possible to write to the same file from two components?

Thanks, Walter

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

You cannot do this if you have two humans trying to manually do it at the same time, neither can you do this with Talend. What you can do is carry out the write in two different subjobs. This is not so much a limitation of Talend, more a limitation of file access. Even if you try to write to two versions of the same flat file simultaneously, you will find that the file that is saved last will overwrite the other.....as in the manual scenario I described above. 

I suggest writing to two tHashOutput components from your tMap, then writing the contents of one in the next subjob, then the other in a subjob after that. This also means you can reuse the data after it has been processed by your tMap.

View solution in original post

4 Replies
Anonymous
Not applicable
Author

You cannot do this if you have two humans trying to manually do it at the same time, neither can you do this with Talend. What you can do is carry out the write in two different subjobs. This is not so much a limitation of Talend, more a limitation of file access. Even if you try to write to two versions of the same flat file simultaneously, you will find that the file that is saved last will overwrite the other.....as in the manual scenario I described above. 

I suggest writing to two tHashOutput components from your tMap, then writing the contents of one in the next subjob, then the other in a subjob after that. This also means you can reuse the data after it has been processed by your tMap.
_AnonymousUser
Specialist III
Specialist III

Hi,
I followed your suggestion and wrote the data into two tHashOutput and from then with two subsequent subjobs into one Excel file. Works perfect.
Anonymous
Not applicable
Author

It is actually possible to do that. Because all actions are thread save you could write into different sheets in the same job and from the same tMap. The problem lies in the Talend implementation of the output component for Excel.
If you use the tFileExcelSheetOutput component (in conjunction with tFileWorkbookOpen and tFileExcelWorkbookSave) from Talend Exchange, this scenario will work out of the box!
Anonymous
Not applicable
Author

I should have said that the Talend component essentially opens a copy of the file for each component being used. You cannot manually open two versions of the same Excel file (with Excel) at the same time. I am assuming (JLolling) that your component shares a connection to the Excel file with any other instances of your component that are interacting with the same file, and that is how what you are saying is possible. If so, I may be interested in using that 🙂