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
Master III
Master III

Re: RE:Size Reduce

Try this

try this...

=replace(field name,' ',chr(13)&' ')

Highlighted
MVP & Luminary
MVP & Luminary

Re: RE:Size Reduce

Hi,

The best option for this scenario is use horizontal orientation.

Regards,

Jagan.

Highlighted
MVP
MVP

Re: RE:Size Reduce

It is a little complex to break intelligently on spaces or hyphens, but here some code that you could incorporate into your load after you have loaded the table containing the label to split. Assuming the table is named Data and the field is called Label:

Set vBreak = 20;  // maximum length

WrapLabel:

LOAD Label,

  If(t1 = 0 And t2 = 0 And ln <= $(vBreak),

  Label,

  If(t1 = 0 And t2 = 0 And ln > $(vBreak) And ln <= $(vBreak) * 2,

  Left(Label, $(vBreak)) & chr(10) & Mid(Label, $(vBreak) + 1, 999),

  If(t1 = 0 And t2 = 0 And ln > $(vBreak) * 2,

  Left(Label, $(vBreak)) & chr(10) & Mid(Label, $(vBreak) + 1, $(vBreak)*2 - 1) & chr(10) & Mid(Label, $(vBreak)*2, 999),

  If(t1 > 0 And t2 <= t1,

  Left(Label, t1) & chr(10) & Mid(Label, t1 + 1, 999),

  If(t2 > t1,

  Left(Label, t1) & chr(10) & Mid(Label, t1 + 1, t2 - t1 -1) & chr(10) & Mid(Label, t2 + 1, 999)

  ))))) As WrapLabel

;

LOAD *,

  If((t1 > 0) And (ln - t1 > $(vBreak)), Index(Mid(st, t1 + 1, $(vBreak)), ' ', -1) + t1, 0) As t2

;

LOAD *,

  If(ln > $(vBreak), Index(Left(st, $(vBreak)), ' ', -1), 0) As t1

;

LOAD *,

  Len(Label) As ln,

  Replace(Label, '-', ' ') As st

;

LOAD Distinct

  Label

Resident Data;

This can remain as a separate table and you can use WrapLabel in place of Label as the chart dimension. Adapt the script to your table and field names. Set vBreak to a suitable break size.

EDIT - on further testing, found a bug with the fixed wrap which is now fixed.

t1.png

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Highlighted
Champion III
Champion III

Re: RE:Size Reduce

nice jonathan..

Highlighted
Champion III
Champion III

Re: RE:Size Reduce

hi settu ,

small changes to ur expression .got the olution wat i required.

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

thanks

Suresh