Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to truncate long labels to the left instead of the default right?

Hi,

I have a bar chart with some labels on the y-axis. The labels can vary very much in length and if the labels are to long they will be truncated to the right, see attached image. The most important text in the labels are the end of the labels (the number in the paranthesis in this example) and this is what gets truncated. What I want to do is to instead truncate the labels to the left so that I always can see the end of the labels.

How it looks now:

                             com.mytest (3)

com.mytest.application.medium (2)

com.mytest.application.verlongtex

How I want it to look:

                             com.mytest (3)

com.mytest.application.medium (2)

m.mytest.application.verlongtex (1)

I tried using the Right() function on the label but that completely removed some part of the label and I do not want to do that. I still want to be able to hover the mouse over the label and get the complete (untruncated) label in the tool tip that shows up.

How can I do this?

1 Reply
Anonymous
Not applicable
Author

How about creating the shorter dimension, using Right(fieldname,x) in the script or as a calculated dimensions, and using this as your primary dimension that shows on the legend.

You could then add another expression with only(fieldname) that has none of the display options (Line, Bar or Symbol) checked on the Expressions properties, but instead has the 'Text as Popup' checked. This turns the icon to the left of the expresison into some sort of information mark and shows the text in the popup below the other expressions.

The chopped up primary dimension appears in the same popup though unfortunately.

Jonathan