7 Replies Latest reply on Aug 22, 2016 10:48 AM by lindseym

    Nested Calculations

    lindseym

      Hello,

       

      I have a current calculation that works great. This issue is I became aware of a situation that now needs to be factored in.

       

      Currently here is what happens.

       

      Screen Shot 2016-08-17 at 11.17.43 AM.png

       

      I want the leading 000 to be removed from the copy (side a) if they are present. 

       

      I think a "getasnumber" parameter would work, but I am a little confused how / where to add it.  So it only evaluates for leading zeros if Copy (Side A) = LOC # and Location Calculation has leading zeros. There are times there will be 2 leading zeros or maybe 5, definitely not consistent.

       

       

       

      Here is my current Case calculation:

      -------------------

      Case (

       

       

      ${Copy (Side A)} = "LOC #" ;

      Substitute ( LeftWords ( Location Calculation ; 1 ) ; "TBD" ; TextStyleAdd ( "TBD" ; HighlightYellow ) );

       

      Substitute (

      ${Copy (Side A)} ;

      ["TBD" ; TextStyleAdd ( "TBD" ; HighlightYellow )];

      ["LOC #" ; LeftWords ( Location Calculation ; 1 )]

      )

       

       

      )

       

       

      --------------------

       

      Thank you.