Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

New Contributor

Creating a multline x axis in a bar chart

Hi, I am creating a chart to show survey results.  Each question on the survey is varying in in length from 50-200 characters.  When I create the chart many of the questions are too long to display.  So I have created a method to split the lines dynamically.  Below is my code followed by the problem I'm facing:

=if(len(QuestionTXT) < 50, //if the length is more than 50...


& chr(13) &

right(QuestionTXT, round(len(QuestionTXT)/2)), //then split it into two lines


& chr(13) &


& chr(13) &

right(QuestionTXT, round(len(QuestionTXT)/3))) //otherwise split it into three lines

This is working but with some burps.  I think because of the rounding function its giving some mixed results.

One two line question looks like this:

"I can use R to
o work with the data"

The full question is "I can use R to work with the data"

Another prints out:

"I can effectively
profile a dataset to un
rstand its limitations"

For that one the full question is ""I can effectively profile a dataset to understand its limitations" (notice its missing "de")

I'd love some tips to tighten this up and make it more humanely readable.


1 Reply
Contributor III

Re: Creating a multline x axis in a bar chart

Try using Chr(10) instead of Chr(10). It's cleaner I believe.

Round is the issue I believe.

Community Browser