How to add a line break to wrap text using custom expression in Spotfire

How to add a line break to wrap text using custom expression in Spotfire

book

Article ID: KB0070931

calendar_today

Updated On:

Products Versions
Spotfire Analyst All Versions

Description

If you are using the Concatenate function to combine two piece of information like Concatenate([Column1], " ", [Column2]) you may want to show the information as table columns or visualization labels and may want to insert a line break to wrap the two strings on different lines. By default, the concatenation will occur with no line breaks.

For example, see the labels in the screenshot below, without a line break. The custom expression used on the Labels axis here is:
 Concatenate([Store Name]," ",[Rank])
User-added image

Issue/Introduction

How to add a line break to wrap text using custom expression in Spotfire

Resolution

In custom expressions, "\n" is used for adding a line break in text. To add a line break to wrap the text, use either of the following custom expressions:
 Concatenate([Column1], "\n ", [Column2])
or:
 [Column1] & "\n " & [Column2]

In the example above, change the custom expression to either of the following, and the line break will be added in the labels.
 Concatenate([Store Name],"\n ",[Rank])
or:
 [Store Name] & "\n " & [Rank]
User-added image

The same expression works for other fields like calculated columns and Map chart labels.
User-added image
User-added image

Note: This solution may not work in all parts of the product, where multiple lines may not be supported. If you have a need for this type of multi-line functionality in some part of the product where it's currently not possible, please make sure to create an idea in the Ideas Portal:  https://ideas.tibco.com/
 

Additional Information

Doc: Text Functions