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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Setting a context variable with a value contains one ROW of database using tJava

How to set Context Variable from tMap which fetches the Row.File_name from databse such that  i can use that Context Variable in tFileInputExcel as a File Name 

 

ScreenShot of Problem has been Shared Below0683p000009Lybw.pngWant to set row1.file_Name in Context Variable0683p000009Lyfd.pngOutPut contains File Name and Date want to set FileName as Context Variable such that i can use that fileName in any component 

OutPut contains File Name and Date want to set FileName as Context Variable such that i can use that fileName in any component

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi,

After tMap use tJavaRow here, In tJavaRow use below code -
context.filename = <row>.filename
This code will set the value in context variable, then using OnSubJobOk, you can use this variable to read file.

Best Regards,
Abhishek

View solution in original post

12 Replies
Anonymous
Not applicable
Author

Hi,

After tMap use tJavaRow here, In tJavaRow use below code -
context.filename = <row>.filename
This code will set the value in context variable, then using OnSubJobOk, you can use this variable to read file.

Best Regards,
Abhishek
Anonymous
Not applicable
Author

@manodwhb
How can i set row1.file_name in tContextLoad
there is no field in which i can set key and value
Anonymous
Not applicable
Author

This is not Working !!
@abhishek
Anonymous
Not applicable
Author

Could you please provide a screenshot how are you using it
OR
Where is it failing ?

Best Regards,
Abhishek
manodwhb
Champion II
Champion II

@meetmahajan,you should get only one field into tlog that filename

Anonymous
Not applicable
Author

manodwhb
Champion II
Champion II

@meetmahajan Transfer field should be created in context tab with sting type.

Anonymous
Not applicable
Author

@manodwhb

Still getting an error 

in tLogRow there is only one field row1.File_Name

0683p000009Lyfs.png