Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

saran7de
Contributor III

Escape \n

I have a situation here. My text has something like below.

\\nabcdefgh

Here '\n' is considered as New-Line and I'm getting the output like below (split of line).

\

abcdefgh


Is there any work around? How to escape '\n' here?

Please advise.


4 Replies

Re: Escape \n

What will data like this be used for? If it's allowed to add a single space between the last backslash and the 'n' character, you could break the C-like interpretation of special characters. Like in:

=Replace('\\nabcdefgh', '\n', '\ n')

And note that this translation only happens at the display stage, not while manipulating data in fields.

Best,

Peter

saran7de
Contributor III

Re: Escape \n

Thanks, Peter. This is helpful.

It's just a text object to display some information. So, this should work.

MVP
MVP

Re: Escape \n

Hi,

You can replace it by using Replace() like below

=Replace('\\nabcdefgh', '\n', '')

You can do this in script like below

LOAD

Replace(FieldName, '\n', '') AS FieldName,

,

,

,

FROM DataSource;


Hope this helps you.


Regards,

Jagan.

MVP
MVP

Re: Escape \n

Hi,

If you got the answer close this thread by giving Correct and Helpful answers to the posts which helps you.

Regards,

Jagan.

Community Browser