1 Reply Latest reply on Mar 12, 2010 7:27 AM by Steve Wright

    Address Calculation

    ThomasShaw

      Title

      Address Calculation

      Post

      I'm looking to make a 1 line address calculation.

       

      I have:

      Address Line 1

      Address Line 2

      City

      State

      Zip

       

      Some addresses will require a line 2 but some will not.  How can I make a calculation to skip Address Line 2 if it's empty?

       

      Many thanks in advance!

        • 1. Re: Address Calculation
          Steve Wright

          If you wanted it so each line was seperated by a line break, but without gaps, you could use

           

          Let ( 
          [ 
           a = Address Line 1 ;
           b = Address Line 2 ;
           c = City ;
           d = State ;
           e = Zip 
          ];
          
          List ( a ; b ; c ; d ; e )
          )

           

          If you want it comma seperated you could substitute the line break and use : 

           

          Let ( 
          
          [ 
           a = Address Line 1 ;
           b = Address Line 2 ;
           c = City ; 
           d = State ; 
           e = Zip ;
          all = List ( a ; b ; c ; d ; e) 
          ];
          
          
          substitute ( all ; "¶" ; ", " )
          )

           

          Obviously, where I have put a=, b= etc isnt really required but makes it easier to follow.