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: 
Not applicable

Wrap Dimension

Hello

I would like to know if there's a way to wrap text a dimension on a bar chart.

I have a bar chart with agent names as dimension and the names are pretty long. Is there a way I can wrap the text or get it to show fully?

Zama

17 Replies
Not applicable
Author

Hill Bill,

Can you let em know what does the middle things refers to (in this case 21)...

I understood that 5 refers to number of character on one single line. But not sure about 21

   = mid(Dim , 21, 5 )

Not applicable
Author

Also, what if i want to have another condition wherein it first searches if there is a space between the text.. For eg  'Capital Markets'.... Capital should be on line 1 and markets on second line for that particular bar . if there is no space then it can use your current code of divinding it into 5 letters each line

Anonymous
Not applicable
Author

Yousuf

The QlikView Help is always the first place I go to for information on QlikView functions.  Below I have pasted in the entry for mid()

mid(s, n1[, n2 ])

Substring of the string s. The result is the string starting at character n1 with the length of n2 characters. If n2 is omitted, the function returns the rightmost part of the string starting at character n1. The positions in the string are numbered from 1 and up.

Example:

mid('abcdef',3 ) returns 'cdef'.

mid('abcdef',3, 2 ) returns 'cd'.

mid( Date,3 ) where Date = 970714 returns 0714.

mid( Date,3,2 ) where Date = 970714 returns 07.

For a more complicated example, see the index function below.

So from that you see that The result is the string starting at character n1 and n1 is 21 in this case.

Best Regards,     Bill

Anonymous
Not applicable
Author

Yousuf

As I said earlier my qvw is a 'bit rough & ready, but I am sure it could be polished up'.

I have given you the principle.  The polishing up you need to do will primarily be manipulating strings.  I'd suggest you give it a go yourself, but first have a look in the QlikView Help at all the String Functions and see what such functions exist - you'll find your new friend the mid() function there as well.

If you have specific questions about any of these functions, then if you start a new thread here on the QlikCommunity, then I am sure your question will be answered.

Best Regards,     Bill

Not applicable
Author

Somehow i did what you suggested. But output is not coming as desired.....Please refer to the attachement.

Not applicable
Author

I think they already gave you the ans... =D similar way, used chr(10)

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Alternate display methods (because this will never lead to a satisfactory solution in all situations):

  • Cut the label as explained before by limiting the number of characters. Use the pop-up tooltip to display the full dimension value, or
  • rotate your chart 90deg to get more space for long dimension values (see chart properties->style)

Good luck,

Peter

Anonymous
Not applicable
Author

Yousef

My earlier suggestion does not work for Stacked Bar Charts.

But how about simply changing the bar orientation, see attached.

Best Regards,     Bill