Skip to Content
avatar image
Former Member

how should remove prefix zero in dimension.

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Dec 23, 2014 at 09:35 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 23, 2014 at 08:56 AM

    Use Replace function.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 23, 2014 at 09:14 AM

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

    Add comment
    10|10000 characters needed characters exceeded