Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
datanibbler
Champion
Champion

String functions, the scary type, in a dimension

Hi,

my issue is the following:

- Basically, the Dimension of my Chart is a Label - the Label of a cost_Center;

- The Labels only differ very much in length which is Kind of annoying in the Chart;

- => So I devised a set of rules by which the individual elements of These Labels are not abbreviated;

- => Now the Dimension is that abbreviated Version;

- Still, it could of course be that it is about 25 characters Long and I actually Need a line_break;

- => So I want to introduce a formula by which to insert linebreaks if there are several individual words, that's easy;

- <=> But when the first word consists of just 2 letters, which happens because of my Abbreviation rules, I don't want to include a
          line_break after those 2 lettters ...

- => So I Need some mechanism by which to identify

       - how many individual words (separated by blanks) I have

       - how many of those I can put on one line before reaching, say, 20 characters - of course I don't want to end up

          ripping words apart ...

Challenging. Let's see.

Best regards,

DataNibbler

1 Solution

Accepted Solutions
datanibbler
Champion
Champion
Author

Okay,

I made it. There was only one issue, but I fixed that - for now.

I now query the length of the term and if it surpasses a Limit of 15 characters, I further check whether there is one separating blank or two and in each case I check again how many of the segments I can fit on one line before exceeding 15 characters and doing a line_break.

Unfortunately, that formula is based on the set of rules for Abbreviation which I thought up based on the Labels I have right now - if going Forward there should be a new Label, that might not fit my rules and there might be a Display Problem in that Chart - but that was the best I could come up with.

View solution in original post

1 Reply
datanibbler
Champion
Champion
Author

Okay,

I made it. There was only one issue, but I fixed that - for now.

I now query the length of the term and if it surpasses a Limit of 15 characters, I further check whether there is one separating blank or two and in each case I check again how many of the segments I can fit on one line before exceeding 15 characters and doing a line_break.

Unfortunately, that formula is based on the set of rules for Abbreviation which I thought up based on the Labels I have right now - if going Forward there should be a new Label, that might not fit my rules and there might be a Display Problem in that Chart - but that was the best I could come up with.