Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Adding text numbers with Leading 0

Hello!  I hope someone can help me on this.  I want to add 2 fields in text  and number format.  However , I want the results in text format with leading 0 as shown below "Result"  column...Thus, the results should be in Seq field format.

I tried  Text(Num(Seq+counter,Repeat('0',Len(Seq))))  to no avail ...

   

SeqcounterResult
000410005
0032005
02103
123
213
00005200007

Thank you in advance.

1 Solution

Accepted Solutions
tamilarasu
Champion
Champion

Hi Caroline,

Try this,

Text(Num(Num#(Seq,'#') + counter, Repeat('0',Len(Seq))))

View solution in original post

14 Replies
vishsaggi
Champion III
Champion III

What is the problem with your expr? This is what i am getting when i use your expr?

LOAD *, Text(Num(Seq+counter, Repeat('0',Len(Seq)))) As Result INLINE [

Seq, counter

0004,  1

003,   2

02,   1

1,   2

2,   1

00005, 2

];

Capture.PNG

Anil_Babu_Samineni

Good solution, But why third one shows normally again ??

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Anil_Babu_Samineni

Will you provide real values?

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Anonymous
Not applicable
Author

Hi! Vishwarath ,

My Seq column is in text format.  Anyway, How did you make it to number and keeping the leading 0s?

Tks.

Anonymous
Not applicable
Author

Hi!  Anil,

Like this?

   

SeqcounterOutput
01102
000210003
000110002
000210003
0021003
01102
12

3

Anil_Babu_Samineni

Your expression perfectly works until unless Unique Seq is not in the list. So, Could be issue over there. Let me recommend one person who is do some good job marcowedel

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
vishsaggi
Champion III
Champion III

Oops I missed it.

tamilarasu
Champion
Champion

Hi Caroline,

Try this,

Text(Num(Num#(Seq,'#') + counter, Repeat('0',Len(Seq))))

vishsaggi
Champion III
Champion III

Try this?

LOAD Text(Seq) as Seq, counter,Text(Num(Seq+counter, Repeat('0',Len(Seq)))) As Result INLINE [

Seq, counter

0004,  1

003,   2

02,   1

1,   2

2,   1

00005, 2

];