Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
colinodonnel
Creator II
Creator II

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

1 Solution

Accepted Solutions
5 Replies
Digvijay_Singh

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
Creator II
Creator II
Author

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

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
Creator II
Creator II
Author

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
Creator II
Creator II
Author

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.