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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to insert tfilelist variable in table

Hi guys,

 

I'm Using a tFileList and a tFileInputPositional to read files from some subfolders and Insert the data in a sql table.

I would like to insert also in the sql table a new column with the folder name (given by the tFileList).

How can I do that?

I leave you with a print of my job:

0683p000009Lrjm.png

Thanks,
Miguel Cunha

Labels (1)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

You have to map your data ...  just with drag and drop

0683p000009LrqF.png

 


Capture.PNG

View solution in original post

6 Replies
Anonymous
Not applicable
Author

Hi
Add a tMap before tDBxxxOutput component, add a new column and set its expression with the global variable.

Regards
Shong
Anonymous
Not applicable
Author

@shongthank you for your help.

I did what you say but the output was null for all columns.

Am I doing something wrong?

 

0683p000009Lrob.png

Anonymous
Not applicable
Author

You have to map your data ...  just with drag and drop

0683p000009LrqF.png

 


Capture.PNG
Anonymous
Not applicable
Author

@sgvStill not working. 0683p000009MPcz.png

Now all columns ourtuput is ok, except the variable one.

Is the variable ok? ((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))

Anonymous
Not applicable
Author

It's depend of the name of your variable.
So your tFileList have a Talend Name and a Personnal name (default : personnal name = talend name).
for exemple :  0683p000009Lrqt.png

Here, personnal name is "azerty" and TalendName is "tFileUnarchive_1"

 

So what is the purpose of that :

When you want to use a global variable, you have just to write this : "azerty." and then if you press "Ctr+space", talend will give you every global var generated  by the component.

like this :

0683p000009Lrqy.png

 

Then, you have juste to choise the global var needed, and Talend will give you the appropriate code. In this case, I want the CURRENT_FILEPATH : ((String)globalMap.get("tFileUnarchive_1_CURRENT_FILEPATH"))

 

 

It's really important to understand that if you want to use global var from component.

 

In your case, maybe you can rename your tFileList with a name variable more appropriate, like ListeFile

And then in your tMap try to write "ListeFile." and press "Ctr+Space"

Good luck

SGV

Anonymous
Not applicable
Author

@sgvThank you very much. I already made it but your answer made me understand a little more about those variables.

0683p000009MACn.png