Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

imtiaz_ullah
New Contributor II

Carriage Return/Linefeed in Expression

Hi I am trying to add a new line in an expression in QlikSense but cannot get anything to work.

I have tried the below, and have also tried using \n to no avail. Any thoughts?

'Origin:' & Origin & Chr(13) & Chr(10) & BrandName & ' - ' & AncType & '(' & AncSubType & ') = ' & COUNT(CustomerID)

Thanks

Immy

Tags (1)
1 Solution

Accepted Solutions

Re: Carriage Return/Linefeed in Expression

What type of chart / object are you using?

Chr(10) works in the expression of a text box.

sense2.JPG

10 Replies
datanibbler
Esteemed Contributor

Re: Carriage Return/Linefeed in Expression

Hi,

in strings, chr(10) always worked for me up to now - chr(10) was never needed.

But I am working with QlikView, not QlikSense, so there might be a difference?

Best regards,

DataNibbler

Re: Carriage Return/Linefeed in Expression

What type of chart / object are you using?

Chr(10) works in the expression of a text box.

sense2.JPG

imtiaz_ullah
New Contributor II

Re: Carriage Return/Linefeed in Expression

Am using an extension from a 3rd party. Do you think the issue is with them?

Re: Carriage Return/Linefeed in Expression

Yes it could be.

Test your expression in a standard object such as the Text & Image object, and if that works, it is an issue for the developer of the extension.

imtiaz_ullah
New Contributor II

Re: Carriage Return/Linefeed in Expression

Yes, correct. I'll throw it back to them. Thanks

Re: Carriage Return/Linefeed in Expression

One other thought, try adding a Maxstring() around any other fields in your text expression, as all fields should be referenced using some aggregation function.

If you do not specify an aggregation expression then QlikView can effectively add an only() around the expression thus the value will return null unless only one value is returned. I guess this also applies in Sense.

Try

'Origin:' & maxtstring(Origin) & Chr(13) & Chr(10) & maxstring(BrandName) & ' - ' & maxstring(AncType) & '(' & maxstring(AncSubType) & ') = ' & COUNT(CustomerID)

imtiaz_ullah
New Contributor II

Re: Carriage Return/Linefeed in Expression

Doesn't look like QS likes the maxstring function.

Re: Carriage Return/Linefeed in Expression

maxstring(name) & ' ' & count(customer)  works fine in a text object for me in Sense 1.1.0

Try adding your expression in a text object rather than the 3rd party extension.

Prove your expression works first.

imtiaz_ullah
New Contributor II

Re: Carriage Return/Linefeed in Expression

Official reply from Idevio Support - "Sorry, but only single line labels are supported."