Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 ...
Seq | counter | Result |
0004 | 1 | 0005 |
003 | 2 | 005 |
02 | 1 | 03 |
1 | 2 | 3 |
2 | 1 | 3 |
00005 | 2 | 00007 |
Thank you in advance.
Hi Caroline,
Try this,
Text(Num(Num#(Seq,'#') + counter, Repeat('0',Len(Seq))))
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
];
Good solution, But why third one shows normally again ??
Will you provide real values?
Hi! Vishwarath ,
My Seq column is in text format. Anyway, How did you make it to number and keeping the leading 0s?
Tks.
Hi! Anil,
Like this?
Seq | counter | Output |
01 | 1 | 02 |
0002 | 1 | 0003 |
0001 | 1 | 0002 |
0002 | 1 | 0003 |
002 | 1 | 003 |
01 | 1 | 02 |
1 | 2 | 3 |
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
Oops I missed it.
Hi Caroline,
Try this,
Text(Num(Num#(Seq,'#') + counter, Repeat('0',Len(Seq))))
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
];