cancel
Showing results for 
Search instead for 
Did you mean: 

how should remove prefix zero in dimension.

Former Member
0 Kudos

Hi Expert,

I have one requirement remove prefix zero in  dimension.

Example:

dimension:Plant

                00004567

               0005673

               0023GTY

               003TG/ER

EXPECTED OUTPUT;

Plant:

4567

5673

23GTY

3TG/ER

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

May be this will be ideal solution.

1. Dimesion Name is Plant

2. Startposition= If Substr([Plant];1;1)<>"0" Then 1 ElseIf Substr([Plant];2;1)<>"0" Then 2 ElseIf Substr([Plant];3;1)<>"0" Then 3 ElseIf Substr([Plant];4;1)<>"0" Then 4 ElseIf Substr([Plant];5;1)<>"0" Then 5

3. final Output=Substr([Plant];[ Startposition];Length([Plant])-[ Startposition]+1)

This will help like:

000546 will be 546 ,

0005460 will 5460. (if we use leftrim and replace function will be you only 546)

Please let me know if u have need any clarifications.

Former Member
0 Kudos

=LeftTrim(Replace([Plant];"0";""))

Former Member
0 Kudos

Use Replace function.