5

I am using QGIS.

I have two shapefiles which I want to join based on address columns. SO far I have not been able to join them. I think the reason might be that one column is capitalized while the other one is NOT all capitalized.

Below are screenshots of the two columns:

anderson_parcel add column

customer_billing address column

How can I capitalize all the strings of "address_2" columns?

4
  • 3
    Did you look in the strings menu, look for to_upper or upper
    – Ian Turton
    Mar 9, 2022 at 18:47
  • Correct me if I am wrong, but I think you will first join the shapefiles together and then use the "Field Calculator" to create a new column that combines the two address columns together.
    – Binx
    Mar 9, 2022 at 19:21
  • @Zman3 Do you know if it is possible to join the shapefiles without specifying join fields? Mar 9, 2022 at 19:28
  • I'm not quite sure if I am following you, but I would suggest having a similar id column in both shapefiles and joining based on that. Would it be possible to share your shapefiles?
    – Binx
    Mar 9, 2022 at 19:37

2 Answers 2

8

Using QGIS, you can use the upper("column name") expression. Open the layer attributes table with the lowercase text, then the field calculator (CTRL+i) and type upper("column name") in the expressions field. Also check 'update existing column' and select the column with the address, you can create a new column too if you prefer.

enter image description here

5

This is not case sensitive.

Step 1

I have two shapefiles. Circles and Squares. Both have an id column/field and both have an address column/field. enter image description here

Step 2

Use the Join Attributes by Field Values tool. For the "Layer 2 fields to copy", select the other shapefiles address column. You can choose to "discard the records which could not be joined" as well. You're call. Save and Run. enter image description here

Step 3

Open the attribute table of the newly created layer and see that they joined based on the id field. enter image description here

step 4

Create a new field and make sure the "Output length" is set high enough for all characters to be present from the concatenation of addresses. Then perform the operation you want. Here I combined the address separated by an --. enter image description here

Step 5

Final Results enter image description here

EDITS

You are correct in thinking that the text needs to match (case sensitive).

  1. Update your address field to all CAPS. Reference @hugonbg answer.

  2. Perform the same steps indicated below expect use the address field as your "Table field" parameter indicated in "Step 2".

8
  • Unfortunately, they don't share any columns (including id fields) except for the address columns, which I provided their screenshots at top Mar 9, 2022 at 22:40
  • @KavehEkbia So how do you know which row from shapefile 1 joins with shapefile 2?
    – Binx
    Mar 9, 2022 at 23:54
  • There are multiple rows from customer_billing(shapefile1) and AndersonParcel2021 (shapefile2) that share a same address. As an example there is a row from shapefile1 that has “2879 E CREEKS DR” and there is a row from shapefile2 that has this value “2879 E Creeks DR”. Therefore these two rows join. There are many other rows similar to the example I just provided. The only difference is that shapefile1 address values are all uppercase while shapefile2 address values are not all uppercase. Mar 10, 2022 at 0:12
  • Do you know how I can make it to work? Mar 10, 2022 at 0:24
  • @KavehEkbia please see the EDITS section and let me know if that works!
    – Binx
    Mar 10, 2022 at 1:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.