Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
amien
Specialist
Specialist

repeat using in Qlik Sense

i want to create this field:

Value1 & Repeat(' ',10-Len(Value1)) & Value2 & Repeat(' ',10-Len(Value1)) & Value3


But for some reason this is not working.


Is there another way to make this work? I also tried with Chr(9).. Same result

Thanks in advanced.

10 Replies
rbecher
MVP
MVP

I think normale spaces get trimmed away. So you could use Unicode ideographic space U+3000 instead:

repeat(chr(num#('3000', '(hex)')), 12)

Astrato.io Head of R&D
amien
Specialist
Specialist
Author

Hi Ralf .. doens't quite work:

LOAD

t1 & repeat(chr(num#('3000', '(hex)')), 6-Len(t1)) & t2 As t3

;

Load * Inline [

t1, t2

8.0, test

11.0, test

111.0, test

]

1.jpg

rbecher
MVP
MVP

I played with a couple of others from  Whitespace character - Wikipedia and 2000 seems to work:

num#('2000', '(hex)')

Astrato.io Head of R&D
JaMajka1
Partner Ambassador
Partner Ambassador

Hello Amien,

try to use chr(127) instead.

BR,

Maria

amien
Specialist
Specialist
Author

Nope . does n't this have something to do with the size of each individual letter?

2018-01-03_12-36-17.jpg

amien
Specialist
Specialist
Author

Thanks for your reply, but 127 has about the same results as my last screenshot

JaMajka1
Partner Ambassador
Partner Ambassador

Actually I thought that your issue was that the character is not repeated as many times as is written in the function. In case of chr(127) it is repeated. But if you want to align the text to the right this would be a problem - the used font is not monospaced so each letter has different width.

BR,

Maria

zebhashmi
Specialist
Specialist

can you show a example table?

amien
Specialist
Specialist
Author

LOAD

t1 & Repeat(Chr(127),10-Len(t1)) & t2 As t3

;

Load * Inline [

t1, t2

Ryan, test

Richard, test

Me, test

]