Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Divyanshu
Contributor II
Contributor II

New line function in the table

Hi All,
I wanted to know if there is a possibility to insert a line break between the values  within an expression.

I have the measure: if(Country='1-World', concat(distinct {$<Country=,Flag={1}>}Country ))
This returns: 'IndiaUsa' and the desired solution is:
India
USA

I want these 2 countries to appear in 2 different rows of the table. Is there any way to achieve this either using a line break function or making any changes in the measure.

Thanks in advance.

 

Labels (2)
1 Solution

Accepted Solutions
GaryGiles
Specialist
Specialist

You can use the chr(10) character to cause a line break:

if(Country='1-World', concat(distinct {$<Country=,Flag={1}>}Country,chr(10) ))

The limitation is that a cell in Qlik table chart chart will only expand to 3 lines, so if your Concat returns more than 3 values, on the first 3 will be display.  A hover-over on the cell will show more values.

View solution in original post

3 Replies
GaryGiles
Specialist
Specialist

You can use the chr(10) character to cause a line break:

if(Country='1-World', concat(distinct {$<Country=,Flag={1}>}Country,chr(10) ))

The limitation is that a cell in Qlik table chart chart will only expand to 3 lines, so if your Concat returns more than 3 values, on the first 3 will be display.  A hover-over on the cell will show more values.

Divyanshu
Contributor II
Contributor II
Author

Hey,

Thanks for the response this does work, but is there any way to deal with the limitation other than hovering on the table?

GaryGiles
Specialist
Specialist

Unfortunately, I do not know of a way to get around the 3 line limitation for table cells.  I've needed that in the past, but never found a work around.  Note that you can use other characters in Concat function to separate the values.  

concat(distinct {$<Country=,Flag={1}>}Country,', ') will make the values more readable and if you select the option to "Wrap text in cells" under Appearance -> Presentation in the properties panel for the table, it will automatically wrap to 3 lines.