Bug report #9628

Wrong column / field calculated in joined table

Added by Adam Scharf over 10 years ago. Updated over 10 years ago.

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


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

sample_table_joincalc_bug.csv Magnifier (10.5 KB) Adam Scharf, 2014-02-23 07:48 PM

census_blockgroups_gshn_area.dbf (3.29 KB) Adam Scharf, 2014-02-23 07:50 PM

census_blockgroups_gshn_area.prj (515 Bytes) Adam Scharf, 2014-02-23 07:50 PM

census_blockgroups_gshn_area.qpj (547 Bytes) Adam Scharf, 2014-02-23 07:50 PM

census_blockgroups_gshn_area.shp (136 KB) Adam Scharf, 2014-02-23 07:50 PM

census_blockgroups_gshn_area.shx (308 Bytes) Adam Scharf, 2014-02-23 07:50 PM


#2 Updated by Giovanni Manghi over 10 years ago

  • Status changed from Open to Closed
  • Resolution set to fixed/implemented

this seems fixed in qgis 2.2, please reopen if necessary.

Also available in: Atom PDF