Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Read about Qlik’s Response to COVID-19 Read the Letter, Join the Group.
Highlighted
Contributor III

Wrap text

Hi,

I need to show Corpus and The Valley in single line.Please find the below image.

Untitled.png

Below is the code used to wrap the text.

=if(SubStringCount(trim(Market),' ')<=6,

  SubField(replace(replace(replace(trim(Market),' -- ','-'),' - ','-'),' (','('),' ',1)

  &' '&SubField(replace(replace(replace(trim(Market),' -- ','-'),' - ','-'),' (','('),' ',2)

  &chr(13)&SubField(replace(replace(replace(trim(Market),' -- ','-'),' - ','-'),' (','('),' ',3)

  &' '&SubField(replace(replace(replace(trim(Market),' -- ','-'),' - ','-'),' (','('),' ',4)

  &chr(13)&SubField(replace(replace(replace(trim(Market),' -- ','-'),' - ','-'),' (','('),' ',5)

  &' '&SubField(replace(replace(replace(trim(Market),' -- ','-'),' - ','-'),' (','('),' ',6)

  &chr(13)&SubField(replace(replace(replace(trim(Market),' -- ','-'),' - ','-'),' (','('),' ',7)

  &' '&SubField(replace(replace(replace(trim(Market),' -- ','-'),' - ','-'),' (','('),' ',8)

  &chr(13)&SubField(replace(replace(replace(trim(Market),' -- ','-'),' - ','-'),' (','('),' ',9)

  &' '&SubField(replace(replace(replace(trim(Market),' -- ','-'),' - ','-'),' (','('),' ',10)

  &chr(13)&SubField(replace(replace(replace(trim(Market),' -- ','-'),' - ','-'),' (','('),' ',11))

Thankk..

Tags (1)
4 Replies
Highlighted

Re: Wrap text

Does this object is fixed, Or you may can increase the height to show single line for axis.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
Contributor III

Re: Wrap text

Is this already the case in the source value ?

If so : maybe you only want to replace the [return to line] by a [space].

So use this :

replace(Market,chr(10),' ')

Highlighted
Esteemed Contributor III

Re: Wrap text

try  like below  with your fields . its working for me in one project.

=left(Account, findoneof(Account, ' ', ceil(substringcount(Account, ' ')/2))) & chr(13) & chr(10) & right(Account, len(Account) - findoneof(Account, ' ', ceil(substringcount(Account, ' ')/2)))

Highlighted

Re: Wrap text

Hi, your expression splits the strings by each ' ' it founds, and insert a chr(13) -new line- after each two ' ' it founds.

The bold-red text is causing the next line in that case:

=if(SubStringCount(trim(Market),' ')<=6,

  SubField(replace(replace(replace(trim(Market),' -- ','-'),' - ','-'),' (','('),' ',1)

  &' '&SubField(replace(replace(replace(trim(Market),' -- ','-'),' - ','-'),' (','('),' ',2)

  &chr(13)&SubField(replace(replace(replace(trim(Market),' -- ','-'),' - ','-'),' (','('),' ',3)

  &' '&SubField(replace(replace(replace(trim(Market),' -- ','-'),' - ','-'),' (','('),' ',4)

  &chr(13)&SubField(replace(replace(replace(trim(Market),' -- ','-'),' - ','-'),' (','('),' ',5)

  &' '&SubField(replace(replace(replace(trim(Market),' -- ','-'),' - ','-'),' (','('),' ',6)

  &chr(13)&SubField(replace(replace(replace(trim(Market),' -- ','-'),' - ','-'),' (','('),' ',7)

  &' '&SubField(replace(replace(replace(trim(Market),' -- ','-'),' - ','-'),' (','('),' ',8)

  &chr(13)&SubField(replace(replace(replace(trim(Market),' -- ','-'),' - ','-'),' (','('),' ',9)

  &' '&SubField(replace(replace(replace(trim(Market),' -- ','-'),' - ','-'),' (','('),' ',10)

  &chr(13)&SubField(replace(replace(replace(trim(Market),' -- ','-'),' - ','-'),' (','('),' ',11))

You want to show in one row all values or just this one? for just this one you should add an exception to this value (maybe using a simple if), to remove the new line from all values revome the bold-red text in your code (this will insert a new line character after the 4th ' ' it founds.