Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey Guys,
I have a dimension "Material Number", where the numbers can be
000002525451012,
0000000695748,
P IND XXX,
B7TRCXX
As result I shall get:
2525451012,
695748,
P IND XXX,
B7TRCXX
if only contains figures and there are zeros at the beginning then the zeros at the beginning have to eliminated. If it contains Letters, the material number shall remain so.
How shall I write in the script?
thank you.
Check here:
How to Trim Leading Zero's from Numeric value of a Alpha Numeric datatype
If(IsNum(Replace(LTrim(Replace(CUSTOMER,'0',' ')),' ','0')), Replace(LTrim(Replace(CUSTOMER,'0',' ')),' ','0'), CUSTOMER) as Customer
or
Alt(Num(Replace(LTrim(Replace(CUSTOMER,'0',' ')),' ','0')), CUSTOMER) as Customer
Check here:
How to Trim Leading Zero's from Numeric value of a Alpha Numeric datatype
If(IsNum(Replace(LTrim(Replace(CUSTOMER,'0',' ')),' ','0')), Replace(LTrim(Replace(CUSTOMER,'0',' ')),' ','0'), CUSTOMER) as Customer
or
Alt(Num(Replace(LTrim(Replace(CUSTOMER,'0',' ')),' ','0')), CUSTOMER) as Customer
Alt(Num(Left(Field,14)),Field)
It works perfectly!!!!
Thanks a lot. Exactly the same problem as in the referenced post.