Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
I think you are right, check this below, showing work around by changing color -
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.
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.
I think you are right, check this below, showing work around by changing color -
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.
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.