linking/joining tables

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

linking/joining tables

Pat Brown
I have a layer which displays quarter degree squares for the whole country. I also have a csv file containing two fields. One of these is a field for quarter degree squares and the other is a plant that occur in those QDSs. The same plant species occurs in a number of different QDSs. I want to join the tables so that I can display the QDSs that have an occurrence of that plant species. I have tried using MMQGIS, using the common filed in each table. However I get an error message:

AttributeError: 'QVariant' object has no attribute 'lower'

Traceback (most recent call last):
  File "C:/Users/Pat/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\mmqgis\mmqgis_dialogs.py", line 648, in run
    output_file_name, self.mmqgis_status_callback)
  File "C:/Users/Pat/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\mmqgis\mmqgis_library.py", line 678, in mmqgis_attribute_join
    key = attributes[join_index].lower().strip()
AttributeError: 'QVariant' object has no attribute 'lower'

I am obviously doing something wrong. Can someone please point me in the right direction to sort this out?

Thanks,

Paddy

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: linking/joining tables

Richard McDonnell

Hi,

Why not carry out the join using the Layer Properties, It will allow you to join based on a common column.

This can be found under Joins in Layer Properties, hit the Plus sign and select your Join Layer, your Join Field and then select your Target Field

Be aware that this doesn’t modify either layer, you will have to save it out as another vector file to make the added fields permanent. Hope that helps!

Regards,

 

Richard.

 

 

From: Qgis-user <[hidden email]> On Behalf Of Pat Brown
Sent: 20 June 2019 14:18
To: QGIS Mailing List <[hidden email]>
Subject: [Qgis-user] linking/joining tables

 

I have a layer which displays quarter degree squares for the whole country. I also have a csv file containing two fields. One of these is a field for quarter degree squares and the other is a plant that occur in those QDSs. The same plant species occurs in a number of different QDSs. I want to join the tables so that I can display the QDSs that have an occurrence of that plant species. I have tried using MMQGIS, using the common filed in each table. However I get an error message:

 

AttributeError: 'QVariant' object has no attribute 'lower'

Traceback (most recent call last):
  File "C:/Users/Pat/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\mmqgis\mmqgis_dialogs.py", line 648, in run
    output_file_name, self.mmqgis_status_callback)
  File "C:/Users/Pat/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\mmqgis\mmqgis_library.py", line 678, in mmqgis_attribute_join
    key = attributes[join_index].lower().strip()
AttributeError: 'QVariant' object has no attribute 'lower'
I am obviously doing something wrong. Can someone please point me in the right direction to sort this out?
Thanks,
Paddy


Email Disclaimer: http://www.opw.ie/en/disclaimer/
_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user