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: 
Anonymous
Not applicable

[resolved] tReplaceList replace char with null

I have an Oracle table containing original character values and replacement values. I am using this as a lookup to tReplaceList. How can I replace a character with no value? i.e. a string "abcd" has the b replaced to give "acd"
I've tried no value in the replacement value but this gives a null pointer exception.

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

An empty String is not null. An empty String is "something", null is nothing. However, I think I see your confusion. Oracle does something ridiculous with empty Strings when you query the data. It assumes an empty String is null (ridiculous behaviour). What you can do is put a tMap between your Oracle query component and your tReplaceList. Use the tMap to replace null with "" (an empty String) and the replacement will work.

View solution in original post

4 Replies
Anonymous
Not applicable
Author

Use an empty String ("").
Anonymous
Not applicable
Author

That doesn't work. In the oracle reference table if I use a null value I get a null pointer exception, everything else just replaces it with the value in the table.
Anonymous
Not applicable
Author

An empty String is not null. An empty String is "something", null is nothing. However, I think I see your confusion. Oracle does something ridiculous with empty Strings when you query the data. It assumes an empty String is null (ridiculous behaviour). What you can do is put a tMap between your Oracle query component and your tReplaceList. Use the tMap to replace null with "" (an empty String) and the replacement will work.
Anonymous
Not applicable
Author

Yes that works. Thanks.