Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Champion III
Champion III

RE:Size Reduce

hi all,

I have small issue:

I need to reduce the size of the label into two lines

means length of the label values.

Example: in my image i hve label name  pharmacy h/w replacement     it is in single line.

REQ: i need that in   two lines:  like:  pharmacy h/w

                                                                      replacement

Please refer the image .

size1.png

Thanks in advance.

Suresh

1 Solution

Accepted Solutions
Highlighted

Re: RE:Size Reduce

May be try with Calculated Dimension. Like

=if(FindOneOf(Dim,' ',1)<10,Left(Dim,FindOneOf(Dim,' ',2))&chr(10)&Mid(Dim,FindOneOf(Dim,' ',2),Len(Dim)) ,

if(FindOneOf(Dim,' ',2)>=10,Left(Dim,FindOneOf(Dim,' ',1))&chr(10)&Mid(Dim,FindOneOf(Dim,' ',1),Len(Dim)),Dim))


Capture.JPG

View solution in original post

14 Replies
Highlighted
MVP & Luminary
MVP & Luminary

Re: RE:Size Reduce

Is it just this one label, or do you require a rule to split labels?

If it is just the one, you can do this in the load script:

LOAD

   MyField,

   Replace(MyField, 'pharmacy h/w replacement', 'pharmacy h/w' & chr(10) & 'replacement') as MyDimension,

This will give you two fields, with and without the line break, so you can use different in different places - you could just rename the field if you only need it once.

If it needs to be more general you could replace all spaces:

   Replace(MyField, ' ', chr(10)) as MyDimension,


But it looks like that could get messy for you.


Working out to only replace a space with a line break if it is in the middle of a long dimension could get quite tricky to achieve.


Hope that helps.


Steve

Highlighted
MVP & Luminary
MVP & Luminary

Re: RE:Size Reduce

I recommend changing the chart orientation on the Style tab so the bars are displayed horizontally. You can resize the chart so the labels show correctly. And you can insert line breaks like Steve‌ explained.


talk is cheap, supply exceeds demand
MVP & Luminary
MVP & Luminary

Re: RE:Size Reduce

Good call gwassenaar‌ - I set about answering the question, rather than engaging brain about whether there was a better way of showing the data.

Highlighted
Master
Master

Re: RE:Size Reduce

Hi ,

By Horizontal orientation  and Control shift you can make your right view,

Bar chart Label.PNG

HTH,

Hirish

HirisH
“Aspire to Inspire before we Expire!”
Highlighted
Champion III
Champion III

Re: RE:Size Reduce

thnx alot fr ur reply dark.

I need for dimension level. not for single field.

Highlighted
Champion III
Champion III

Re: RE:Size Reduce

thnx gysbert.

i need in vertically only....

Highlighted
Champion III
Champion III

Re: RE:Size Reduce

i tried dat one bro...but  i need verical only.... that label names shud be in two lines.

Highlighted
MVP & Luminary
MVP & Luminary

Re: RE:Size Reduce

In that case, you could do the thing of replacing all spaces or underscores with new line characters:

Replace(Replace(MyField, '_', ' '), ' ', chr(10)) as MyDimension,

This will result in many lines for some dimensions though.  Another approach is to create an ApplyMap table of original and replaced dimension names in Excel.  Here you can list all of the original names (which you can copy and paste from a LisBox) and then type into the next cell a new name, that can include line feeds.

You would then have the syntax:

Map_2LineDim:

LOAD

   Orig,

   New

FROM [.\RenameDims.xls]

(biff, embedded labels, header is 1 lines, table is [Rename$]);

LOAD

   MyField,

   ApplyMap('Map_2LineDim', MyField) as MyDimension,

   ...

This way you can control exactly what you have for each dimension.  Also, given that ApplyMap defaults to the original value when no lookup match is found, any values which you don't put in the lookup will appear as they did before.

This post gives a lot more information on ApplyMap:

http://www.quickintelligence.co.uk/applymap-is-it-so-wrong/

Steve

Highlighted

Re: RE:Size Reduce

May be try with Calculated Dimension. Like

=if(FindOneOf(Dim,' ',1)<10,Left(Dim,FindOneOf(Dim,' ',2))&chr(10)&Mid(Dim,FindOneOf(Dim,' ',2),Len(Dim)) ,

if(FindOneOf(Dim,' ',2)>=10,Left(Dim,FindOneOf(Dim,' ',1))&chr(10)&Mid(Dim,FindOneOf(Dim,' ',1),Len(Dim)),Dim))


Capture.JPG

View solution in original post