Page 1 of 1

non significant spaces,on the left must be replaced zeros

Posted: Wed Oct 15, 2008 10:34 pm
by amreesh_singh
The QTY column with integer datatype of length 7 the non significant spaces on the left must be replaced zeros.
If the incoming value is 388, the ouput should be 0000388.

I have used the follwing thing in transformer but its not working

Right(Str("0",7):Trim(Out_Agg.QTY),7)

How to go about it.

Thanks in advance

Amreesh

Posted: Wed Oct 15, 2008 10:58 pm
by cfuller
Try something like -

Fmt(Trim(Out_Agg.OUT),"7'0'R")

:D

(I'm assuming FMT is available in Parallel, I'm not sure, if not sorry I can't help)

Posted: Wed Oct 15, 2008 11:31 pm
by ray.wurlod
Fmt() is not available in parallel jobs. Had you bothered to Search you would have discovered that it's even easier than your "solution". Assuming you require a seven-character wide result with leading zeroes, use something like

Code: Select all

Right(("0000000" : OutAgg.QTY), 7)
The inner parentheses are not actually needed.

Posted: Wed Oct 15, 2008 11:45 pm
by amreesh_singh
ray.wurlod wrote:Fmt() is not available in parallel jobs. Had you bothered to Search you would have discovered that it's even easier than your "solution". Assuming you ...
Hi ,
Can you please provide me the solution , it will be a great help
Thanks

Posted: Thu Oct 16, 2008 1:28 am
by ray.wurlod
Can you please purchase a premium membership, so that you can see my solution (and help to keep DSXchange alive)?