Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

colinodonnel
New Contributor III

Padding Text

Hello all,

How do you add spaces to an expression?

Basically I want to pad text so that I lines up correctly.

I have an expression that says:

='Result: £'&Sum(Sales).

This displays as Result:£123,456

However I would like to display as follows so that it lines up with my worksheet.

Result:           £123,456

I have tried the following but with no avail (QS seems to remove spaces)

'Result:                 £'&Sum(Sales)

'Result: '&'chr(9)&£'&Sum(Sales)

Any thoughts?

As an aside when importing from excel, the following works for me in the script when I am stacking vertical bar graphs and I want the Dimensions to Line up / align:

   right('               '&"Dim1",20) as "Dim1",      

    right('               '&"Dim2",20) as "Dim2",

    right('                 '&"Dim3",20) as "Dim3",

    right('                 '&"Dim4",20) as "Dim4",

Cheers,

Colin

Tags (3)
1 Solution

Accepted Solutions
Digvijay_Singh
Honored Contributor III

Re: Padding Text

I think you are right, check this below, showing work around by changing color -

Re: I am unable add extra blank spaces between characters/words in qliksense "Text & Image" obje...

5 Replies
Digvijay_Singh
Honored Contributor III

Re: Padding Text

You may try this -

='Result:'&repeat(' ',10)&Num(Sum(Sales),'£#,##0.00')

I am suggesting to use repeat function for extra space characters and adding currency sign inside the format string may be.

colinodonnel
New Contributor III

Re: Padding Text

Hello Dignijay,

Thank you for the response.

I am afraid the expression repeat('',10) did not pad the text.

ust to confirm, I have used single quotation marks.

I am using Qlik Sense, February edition, if that makes a difference.

The part of the expression Num(Sum(Sales),'£#,##0.00') worked fine.

Digvijay_Singh
Honored Contributor III

Re: Padding Text

I think you are right, check this below, showing work around by changing color -

Re: I am unable add extra blank spaces between characters/words in qliksense "Text & Image" obje...

colinodonnel
New Contributor III

Re: Padding Text

Thank you for the link.

Yes that does work for me when I am using a  Text and Image Chart.

It solves this particular problem so I will mark it as answered.

It doesn't work for the title of a Bar Graph however but that is a different question.

colinodonnel
New Contributor III

Re: Padding Text

Just noticed that instead of a formula, it is possible  just to add text and colour this white

Again, this only works for the Text and Image Chart.