Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

RTF presentation in table


I have a column in sql database as RTF, i want to show this column in plain table in Qlikview.

How to convert it to string?

7 Replies
Contributor II

Re: RTF presentation in table


   u can make use of


   ord() or chr()  functions



  result- returns number 82

  chr(82) returns R



Not applicable

Re: RTF presentation in table

thanks vibhav for your reply,

one of the values in the field is


Can u please tell me what fuction to apply to convert it in text format

Contributor II

Re: RTF presentation in table

  u can use text

    text() funtcion

Not applicable

Re: RTF presentation in table

i tried the text () but no luck!!

Contributor III

Re: RTF presentation in table

Hello, Were you able to convert RTF into plain text? Any chance you can share your script?

Thank you!

Not applicable

Re: RTF presentation in table

Hi All,

I am beginner with QlikView and I had to face a challenge of extracting the plain text by parsing  RTF/RichText. Seems to be an easy problem and the solution is even easier ,but it took me some time to arrive at the solution, hence i would like to share it with the community. 

I created a custom function in QlikView  by writing a JScript  in the Edit Module (CTRL +M) space. The function is as shown below

function convertToPlain(rtf)


    rtf = rtf.replace(/\\par?/g, "");

    return rtf.replace(/\{\\[^{}]+;\}|[{}]|\\\n?[A-Za-z]+\n?(?:-?\d+)?[ ]?|[{\\\*}]/g, "");


All this function does is replaces the string which matches the regex expression marked in bold with a empty string  "" . I am sure that some of you can write a better Regex Expression, but this was the one which worked for me(there are lot of posts where you find different regex expression which might work for you but you need to do thorough testing). You can use websites such as https://regex101.com/‌ to build your own Regex Exp and test it.

Now all  you have to do is to call this function in your load script as shown below

Load  convertToPlain(<YourRTFColumn>) from <YourSource>;

Please feel free to contribute if you think there is a better way to do it or someone wants to add on to this.

Valued Contributor

Re: RTF presentation in table

Hi, I  am trying to understand how you did this. What if this was your RTF output?

{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 Courier New;}}\viewkind4\uc1\pard\lang1033\f0\fs16\par\parRing stedet F\'d8R utr.\par\parK-pers varsles ETTER utr.\par\parUtr. v/ Vakt-Service\par\par\'c5pningstider:\par\parVarsle inst. ved feil:\parL\'e5ne n\'f8kkel til inst:\parBlokkering v/:\parForsikringsselskap:\parInstruks fra: 13/12/2012\par\par}