Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

amien
Valued Contributor

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
MVP
MVP

Re: repeat using in Qlik Sense

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

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

amien
Valued Contributor

Re: repeat using in Qlik Sense

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

MVP
MVP

Re: repeat using in Qlik Sense

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

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

jamajka1
Contributor

Re: repeat using in Qlik Sense

Hello Amien,

try to use chr(127) instead.

BR,

Maria

amien
Valued Contributor

Re: repeat using in Qlik Sense

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

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

amien
Valued Contributor

Re: repeat using in Qlik Sense

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

jamajka1
Contributor

Re: repeat using in Qlik Sense

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
Valued Contributor

Re: repeat using in Qlik Sense

can you show a example table?

amien
Valued Contributor

Re: repeat using in Qlik Sense

LOAD

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

;

Load * Inline [

t1, t2

Ryan, test

Richard, test

Me, test

]