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: 
_AnonymousUser
Specialist III
Specialist III

Assigning context variables in tJavaRow

Hi I'm trying to assign context variables in a tJavaRow with a tMap output.
My job is like this:
(process)--------tMap---(out)---main---tJavaRow
In my tJavaRow:
context.C1=out.BUSINESS_ID;
context.C2=out.SOURCE;
context.C3=out.COUNTRY;
This returns "null". When I put a tLogRow after my tMap I see the data. I tried with a tJava in vain.
Any Idea?
Thanks
Labels (3)
5 Replies
janhess
Creator II
Creator II

Don't think this is the right way to do it as the conntexts will only have the value of the last mapping. Also tLogRow won't print the context values.
_AnonymousUser
Specialist III
Specialist III
Author

Thanks Janhess
This is exactly I'm trying to do, having the value of the last mapping in my context variables. but it dosn't work.
janhess
Creator II
Creator II

Are you sure? in your tJavaRow put a println for the contexts to see the value.
_AnonymousUser
Specialist III
Specialist III
Author

janhess,
When in my tjavarow I do : System.out.println(context.C1) I have "null" in the console. I can't explain this
janhess
Creator II
Creator II

Ah I remember. You need to specify the input fields as
System.out.println(input_row.field name)
So in your case you would have
context.C1=input_row.BUSINESS_ID;
context.C2=input_row.SOURCE;
context.C3=input_row.COUNTRY;