Bug report #9628
Wrong column / field calculated in joined table
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | - | ||
Category: | Browser | ||
Affected QGIS version: | 2.0.1 | Regression?: | No |
Operating System: | Windows | Easy fix?: | No |
Pull Request or Patch supplied: | No | Resolution: | fixed/implemented |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 18201 |
Description
When calculating a new column / field based on a column from a joined table, the wrong (adjacent to the left) column / field values are used.
Workflow to demo problem:
-Join shapefile with .csv table (sample data use GEOID and GEO.id2 as join fields)
-Edit > Field calculator to create a new field
(in sample data: I want to a new column with sample_table_joincalc_bug_HC02_VC03 values (21st column in joined sample files) converted to real decimal number)
-Fields and Values > sample_table_joincalc_bug_HC02_VC03
-Load all unique values and they look OK & match attribute table contents of intended column
-Complete expression:
toreal( "sample_table_joincalc_bug_HC02_VC03" )
Checking newly created/calculated column, values have been taken from the joined column immediately to the left (sample_table_joincalc_bug_HC02_VC03) of intended column.
I reproduced this with a number of different columns with consistent results. Error is thrown if adjacent column data type is incompatible with conversion (ie, trying to convert target column of integer strings to integers gives an error if column immediately to the left -- erroneously targeted column is non-integer)
PS--I'm a newbie, just joined and this is first bug report, so hopefully not redundant and got most things OK! Thx
History
#1 Updated by Adam Scharf almost 11 years ago
- File census_blockgroups_gshn_area.shp added
- File census_blockgroups_gshn_area.prj added
- File census_blockgroups_gshn_area.dbf added
- File census_blockgroups_gshn_area.shx added
- File census_blockgroups_gshn_area.qpj added
#2 Updated by Giovanni Manghi almost 11 years ago
- Status changed from Open to Closed
- Resolution set to fixed/implemented
this seems fixed in qgis 2.2, please reopen if necessary.