7 Replies Latest reply: May 10, 2017 9:30 AM by Ali Ahmad RSS

    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?

        • Re: RTF presentation in table
          - -


             u can make use of


             ord() or chr()  functions



            result- returns number 82

            chr(82) returns R






            • 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


            • Re: RTF presentation in table
              Alberto Varela

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


              Thank you!

              • Re: RTF presentation in table
                harish krishnamoorthy

                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[d]?/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.

                  • Re: RTF presentation in table
                    Ali Ahmad

                    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}