Skip to main content
Question

How do I concatenate 3 numerical fields into 1 string field?


kmc5678
Contributor
Forum|alt.badge.img+2

In Attribute Manager I have created 3 fields (Borough Code, Block_Leading, Lot_Leading), 2 of which have leading zeros in them. I need to concatenate the three fields into a 10 digit string while retaining the leading zeros in the order listed above. My formula for for Block_Leading is @PadLeft(@Value(Block),5,0) and the formula for Lot_Leading is @PadLeft(@Value(Lot),4,0). Can I concatenate all three fields in a single formula in a new field in Attribute Manager and if so how?

 

4 replies

ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • May 25, 2023

I don't think you need the intermediate step

You could just do this

@Value(Borough Code)@PadLeft(@Value(Block),5,0)@PadLeft(@Value(Lot),4,0)

 


kmc5678
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • May 25, 2023

Thanks for your response ebygomm. I think you're right about removing the intermediate step but the formula above returns a value with like 5 carriage returns in it:

2

 

 

 

 

022600010


ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • May 26, 2023
kmc5678 wrote:

Thanks for your response ebygomm. I think you're right about removing the intermediate step but the formula above returns a value with like 5 carriage returns in it:

2

 

 

 

 

022600010

Are you sure the carriage returns aren't in your first value?

 

If they are you can do @Trim(@Value(Borough Code))


kmc5678
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • June 2, 2023

Thanks ebygomm the carriage returns were in the first value.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings