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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tmap and usage of context variable in ereplace

Hello

 

I am trying to do simple task using tfileinput, tmap and tfileoutput.

 

I read a file and wanted to replace specific string with another string. The another string comes from context variable and it doesn't allow me.

 

following works 

StringHandling.EREPLACE(row1.filescript,"source","myname")

but when I try doing following way it 

context.var1 = "myname"

StringHandling.EREPLACE(row1.filescript,"source",context.var1) it doesn't allow me. If I click Test is shows me following

 

The static field TalendJavaSourceViewer8.ContextProperties.var1 should be accessed in static way

 

Any help how I can use context variable value to replace in my text file.

 

 

 

 

 

Labels (2)
1 Reply
Anonymous
Not applicable
Author

Hello,

Where is the value your are retrieving and assigning it to your context variable? Could you please show us your tMap editor screenshot?

Please check your "Code" tab in your job to see if here will be your compile error highlighted in red line?

Best regards

Sabrina