Feature request #9129
Use columns aliases when doing a "save as..." of a layer/table with a join
|Pull Request or Patch supplied:||No||Resolution:|
When doing a join and then saving the resulting layer/table with the "save as..." option, the joined column names are given the name of the join layer, then a "_" and then eventually the name of the other layer, or more probably a number because of the 10 char limit for shapefiles.
I would be good to allow the user choose to give to columns the string used as aliases. This would be handy for joins but maybe it can be useful also in other cases.
#1 Updated by Antonio Locandro over 3 years ago
I was banging my head all this week on why QGIS did this weird number to joins saved as shapefiles, I guess there is no workaround for this unless one could edit the column names before saving. In my case I would like to keep the original column names as much as possible. As you mention the join column gets the name of the join layer and a "_" but when saved I think it should drop the part before the "_" and try to use the join column names. The Column Names I had have 10 characters but since the join adds the layer name + "_" the saved layer has numbers used for Column Names which proves inconvenient
If the column name is duplicate or too big (shapefile limitation) maybe a popup shows with the problems? something like
Column Name / Error / Rename
B01001_001a / max char / B01001_001
Maybe an option would be to try to use the original join table column names and if not possible display a warning for those ones that are problematic?