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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
bglaplante
Contributor III
Contributor III

Context variable - loses everything after comma in the string

I'm storing a string into a context variable for later retrieval and use on subsequent records.  So I have fileinput -> tMap (to extract this field) -> tJavaRow (context.myinfo = input_row.field1) --- to store the data.

 

Sometimes the data string will contain a comma.  If it contains a comma, when I retrieve the value context.myinfo and output it, I find that everything after the comma (and including the comma) has been removed.

So it the input is "NewCo   Boston MA" --- everything works fine

But if the input is "Joe Eats, INC  Las Vegas NV" -- upon reading the context variable I get "Joe Eats".

I want the whole string, and its pretty surprising to not get it when all I'm doing is write it to a context and later read it.

 

If this is a 'special character' that needs to be escaped --- what is the full list of special characters?

Would setGlobalVar get me around this, or would it have the same problem?

 

Thanks!

0683p000009M7y8.png0683p000009M7kW.png0683p000009M7yI.png

 

tJavaRow4 saves the current record for later use... see the Java code image

tMap16 picks up the "datarecord_prior" from the context.

This goofy file format splits a single record into two lines, so it is necessary to join line 1 to line 2, then 3 to 4, etc.

When the input line contains a comma, when that is saved / retrieved from the context variable everything from the comma onward is lost.

 

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

You are using a tFileInputDelimited component to read this data in. Are you using a comma as a separator in that component? If so, that is your problem

View solution in original post

4 Replies
Anonymous
Not applicable

Could you attach some screenshots of your implementation/data?

bglaplante
Contributor III
Contributor III
Author

Done
Anonymous
Not applicable

You are using a tFileInputDelimited component to read this data in. Are you using a comma as a separator in that component? If so, that is your problem

bglaplante
Contributor III
Contributor III
Author

oh, snap!  Thank you!