Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
alisonpwallis
Creator
Creator

Wrapping dimension text using chr13

Dear All,

I am trying to create a wordwrap on the dimension labels for a chart. I've created the following calculation:

=left([Program Title],15)& chr(13)&mid([Program Title],16)

My questions are :

Is there a way of making it so that the split occurs between a specific number of words rather than just after the 15th character?

Also, this is not actually working - I get the first part of the Program Title and then a big space and the second part doesn't appear at all. What is wrong with my syntax? Or is there something I'm missing somewhere else?

Thanks for your help

Alison

13 Replies
sasikanth
Master
Master

Hi

The approch you are using is not correct , bcz

all the dimension values not have space at 15th charecter, so try to do this

like divide the sentence by 'space' first/second of your choice...

that wil look good than the previous,

for this use subfield function

Gysbert_Wassenaar

In some charts (bar and line chart for example) it's not possible to wrap dimension values over multiple lines. In others you need to enable the option Wrap Cell Text.


talk is cheap, supply exceeds demand
alisonpwallis
Creator
Creator
Author

Thanks for your help. How do I enable the Wrap Cell Text? I've tried doing this in the presentation tab of the chart but this just seems to change it for the legend and not for the dimension.

alisonpwallis
Creator
Creator
Author

Hi, thanks for your help. I've had a go at putting it in the subfield function instead - but what if i don't know how many words there are going to be? I can write something to enter a carriage return after the 3rd word, but how do I just get the rest of the label?

rbecher
MVP
MVP

You could use a calculated dimension like this:

replace(<DimensionField>, ' ', chr(13))

But it will look strange if you have more than two words. Even a two line label takes a lot of space and could cross the next one..

Gysbert Wassenaar this works for line and bar charts, too.

- Ralf

Astrato.io Head of R&D
agomes1971
Specialist II
Specialist II

See caption...

I hope it helps

Kind regards

André Gomes

Gysbert_Wassenaar

Can you post an example document for me? I can't seem to make that work.


talk is cheap, supply exceeds demand
rbecher
MVP
MVP

Here we go..

Astrato.io Head of R&D
alisonpwallis
Creator
Creator
Author

HI Ralf

Thanks for posting this. I've tried it but I think there must be some other setting applied somewhere that is stopping it from showing all the lines. I just get the first word for each label rather than several lines....

Would a theme or something like that prevent it from showing?

Thanks

Alison