Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
On May 18th at 10AM EDT we will answer your QlikView questions live. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
cacosta35
Creator II
Creator II

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

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

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?

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

Hi! Vishwarath ,

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

Tks.

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

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

Hi Caroline,

Try this,

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

View solution in original post

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

];