In QGIS 2.6, creating a virtual field for a layer and adding up 2 integer fields work fine. I get the correct results and I can use that field for styling.

However, when doing a Joins with 2 layers and using a virtual field to add up an integer column from each layer, the results displayed are correct. But QGIS does not recognise the values when styling.

Virtual field

When I try to classify this in the Categorized styling option, no data values are recognised.


The virtual field tooltip describes:

"A virtual field will be recalculated every time it is used. Its definition will be saved in the project file. It will not be saved in the dataprovider and therefore its values not be available in other software."

As it won't be saved in the dataprovider, does that mean QGIS is not even able to read the data? Strangely, I am able to export the layer, including the virtual field, as a .csv which outputs all the correct results for the virtual field.

Is this a possible bug?


The bug report for this problem has been Closed, although I will wait until the next major version of QGIS to test this.

If anyone can confirm this (with screenshots preferably) then I will happily accept your answer.

  • Please open a bug report on hub.qgis.org/issues and attach a sample project/data if possible. – Matthias Kuhn Nov 4 '14 at 11:52
  • As a work around you can do the calculation that forms the virtual field in the "column" using the expression builder. – HeikkiVesanto Jun 26 '15 at 12:18
  • @Vesanto - Thanks buddy! I was aware of that workaround but for the work I am doing, I would rather have the rendering style based on the actual value. You should post your comment as an answer as it is a good workaround, I will upvote it :) – Joseph Jun 26 '15 at 12:43

The bug has been closed and fixed, tested on QGIS 2.12.3:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.