﻿{"id":4599,"date":"2017-12-27T13:06:18","date_gmt":"2017-12-27T12:06:18","guid":{"rendered":"http:\/\/www.sigterritoires.fr\/?p=4599"},"modified":"2018-02-27T19:59:47","modified_gmt":"2018-02-27T18:59:47","slug":"qgis-joins-with-excel-tables","status":"publish","type":"post","link":"https:\/\/www.sigterritoires.fr\/index.php\/en\/qgis-joins-with-excel-tables\/","title":{"rendered":"How to join data from Excel to an attribute table in QGis"},"content":{"rendered":"<p>The present topic is meant as a brief review since the possibility of loading and attach Excel tables was introduced by QGis 1.8.<br \/>\nAs we do not follow the general logic, for new users it is not easy to find the answer. So, step by step, how to make a join between a spatial layer (we&rsquo;ll take an example here with a <a href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/shapefile-vs-geopackage\/\">shapefile<\/a>) and a non-spatial table like Excel (with or without XY fields). <!--more-->To load an Excel table in QGis it is not necessary to go through a plugin (XY Tools, MMQGIS, &#8230;). You will use XY Tools if you want to transform the Excel table with X and Y fields as a spatial layer of points.<\/p>\n<p>By cons if what you want is to join the Excel table to an existing spatial layer through a key (plot number, name of the owner, &#8230;) it&rsquo;s quick and easy.<\/p>\n<h2>1- Load the Excel table in QGis<\/h2>\n<p>This is the trap. To do this, you will use the <em> <strong> Load Vector Layer button.<\/strong><\/em><br \/>\n<a href=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex1.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1747\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/qgis-jointures-avec-des-tables-excel\/ex1-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex1.png?fit=295%2C299&amp;ssl=1\" data-orig-size=\"295,299\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"ex1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex1.png?fit=295%2C299&amp;ssl=1\" class=\"aligncenter size-full wp-image-1747\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex1.png?resize=295%2C299\" alt=\"bouton ajouter une couche vecteur\" width=\"295\" height=\"299\" \/><\/a>It must be known because the Excel table is not a vector layer.<\/p>\n<p>Check that \u00ab\u00a0<em> <strong> All files <\/strong><\/em>\u00a0\u00bb is selected, otherwise you will not see Excel files.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex2.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1748\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/qgis-jointures-avec-des-tables-excel\/ex2-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex2.png?fit=675%2C475&amp;ssl=1\" data-orig-size=\"675,475\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"ex2\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex2.png?fit=630%2C443&amp;ssl=1\" class=\"aligncenter size-large wp-image-1748\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex2-630x443.png?resize=630%2C443\" alt=\"s\u00e9lection du fichier excel \u00e0 charger\" width=\"630\" height=\"443\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex2.png?resize=630%2C443&amp;ssl=1 630w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex2.png?resize=300%2C211&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex2.png?w=675&amp;ssl=1 675w\" sizes=\"auto, (max-width: 630px) 100vw, 630px\" \/><\/a><\/p>\n<p>The Excel table then appears in the list of layers. You can open the table in the same way as other tables in the spatial layers loaded in QGis. You can also switch to edit mode, edit the table and save it. You will have updates to your Excel table, in the same way as if you had done them with Excel.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex3.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1749\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/qgis-jointures-avec-des-tables-excel\/ex3-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex3.png?fit=1215%2C487&amp;ssl=1\" data-orig-size=\"1215,487\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"ex3\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex3.png?fit=630%2C253&amp;ssl=1\" class=\"aligncenter size-large wp-image-1749\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex3-630x253.png?resize=630%2C253\" alt=\"table excel charg\u00e9e en tant que couche dans qgis\" width=\"630\" height=\"253\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex3.png?resize=630%2C253&amp;ssl=1 630w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex3.png?resize=300%2C120&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex3.png?w=1215&amp;ssl=1 1215w\" sizes=\"auto, (max-width: 630px) 100vw, 630px\" \/><\/a><\/p>\n<h2>2- Load the spatial layer<\/h2>\n<p>Now load the spatial layer to which you want to attach the information contained in the Excel table.<br \/>\nFor our example we will load a shapefile with <em> oyster farms.<\/em><\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex4.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1750\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/qgis-jointures-avec-des-tables-excel\/ex4-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex4.png?fit=1328%2C725&amp;ssl=1\" data-orig-size=\"1328,725\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"ex4\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex4.png?fit=630%2C344&amp;ssl=1\" class=\"aligncenter size-large wp-image-1750\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex4-630x344.png?resize=630%2C344\" alt=\"table d'un shapefile charg\u00e9e dans qgis\" width=\"630\" height=\"344\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex4.png?resize=630%2C344&amp;ssl=1 630w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex4.png?resize=300%2C164&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex4.png?w=1328&amp;ssl=1 1328w\" sizes=\"auto, (max-width: 630px) 100vw, 630px\" \/><\/a><\/p>\n<p>We will now join the Excel table using the <strong> ZTABISSEM <\/strong> field of the shapefile layer and the <strong> STATION <\/strong> field of the Excel table.<\/p>\n<h2>Joining Shapefile &#8211; Excel<\/h2>\n<p>Double-click the shapefile layer in the Layers panel<br \/>\nThe properties window of the layer opens. Select <em> <strong> Joints <\/strong> <\/em> tab and click on the green cross to add a join.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex5.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1751\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/qgis-jointures-avec-des-tables-excel\/ex5-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex5.png?fit=843%2C386&amp;ssl=1\" data-orig-size=\"843,386\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"ex5\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex5.png?fit=630%2C288&amp;ssl=1\" class=\"aligncenter size-large wp-image-1751\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex5-630x288.png?resize=630%2C288\" alt=\"onglet jointure des propri\u00e9t\u00e9s de la couche\" width=\"630\" height=\"288\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex5.png?resize=630%2C288&amp;ssl=1 630w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex5.png?resize=300%2C137&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex5.png?w=843&amp;ssl=1 843w\" sizes=\"auto, (max-width: 630px) 100vw, 630px\" \/><\/a><\/p>\n<p>The join definition window opens<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex6.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1752\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/qgis-jointures-avec-des-tables-excel\/ex6-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex6.png?fit=522%2C350&amp;ssl=1\" data-orig-size=\"522,350\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"ex6\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex6.png?fit=522%2C350&amp;ssl=1\" class=\"aligncenter size-full wp-image-1752\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex6.png?resize=522%2C350\" alt=\"dialogue ajouter une jointure vecftorielle\" width=\"522\" height=\"350\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex6.png?w=522&amp;ssl=1 522w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex6.png?resize=300%2C201&amp;ssl=1 300w\" sizes=\"auto, (max-width: 522px) 100vw, 522px\" \/><\/a><\/p>\n<ul>\n<li>In <em> Join Layer<\/em> select the Excel table &lt;\/ li&gt;<\/li>\n<li>In <em> join field in the attached layer <\/em> select the key field of your Excel table<\/li>\n<li>In <em> Join field in the target layer <\/em> select the key of your shapefile<\/li>\n<li>Click <strong> OK <\/strong> to close the join definition window<\/li>\n<li>Click <strong>OK <\/strong> to close the Layer Properties window<\/li>\n<\/ul>\n<p>If you now open the shapefile layer table, you will see that the fields in the Excel table appear after the fields that were already present.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex7.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1753\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/qgis-jointures-avec-des-tables-excel\/ex7-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex7.png?fit=855%2C229&amp;ssl=1\" data-orig-size=\"855,229\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"ex7\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex7.png?fit=630%2C169&amp;ssl=1\" class=\"aligncenter size-large wp-image-1753\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex7-630x169.png?resize=630%2C169\" alt=\"r\u00e9sultat de la jointure excel-shapefile\" width=\"630\" height=\"169\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex7.png?resize=630%2C169&amp;ssl=1 630w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex7.png?resize=300%2C80&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2015\/06\/ex7.png?w=855&amp;ssl=1 855w\" sizes=\"auto, (max-width: 630px) 100vw, 630px\" \/><\/a><\/p>\n<p>If you save your project now, you can continue to update your Excel table without QGis, but when you open the project again you will find all the changes made to the Excel table. The join is a dynamic link and the attached table is calculated on the fly at each opening.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The present topic is meant as a brief review since the possibility of loading and attach Excel tables was introduced by QGis 1.8. As we do not follow the general logic, for new users it is&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"give_campaign_id":0,"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"sfsi_plus_gutenberg_text_before_share":"","sfsi_plus_gutenberg_show_text_before_share":"","sfsi_plus_gutenberg_icon_type":"","sfsi_plus_gutenberg_icon_alignemt":"","sfsi_plus_gutenburg_max_per_row":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1260],"tags":[],"class_list":["post-4599","post","type-post","status-publish","format-standard","hentry","category-non-classe-en"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p6XU0A-1cb","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/posts\/4599","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/comments?post=4599"}],"version-history":[{"count":0,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/posts\/4599\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/media?parent=4599"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/categories?post=4599"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/tags?post=4599"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}