Skip to main content
improve post
Source Link
J. Monticolo
  • 16k
  • 1
  • 30
  • 65

Virtual layer acessingaccessing virtual field

I have a layer (my_layer)my_layer containing a virtual field (virtual_1)virtual_1. Next step I want to create a virtual layer, which list only unique values (as ana bonus also dissolves the geometries by unique values).

The following query for the virtual layer does notdoesn't work with virtual fields:

SELECT DISTINCT virtual_1 from my_layer 
SELECT DISTINCT virtual_1 from my_layer 

How could the desired outcome be achieved?

Some notes/ideas:

  • I need an dynamic solution, as the data in "my_layer"my_layer gets updated reguarly. So unfortunately the Vector>Analysis>Unique Values is notisn't an option. Also Dissolving by virtual field is therefore not an option.
  • Would it work to generate the virtual field inside the Queryquery itself? How could an expression of the field editor evaluated in the virtual-field-query?

Virtual layer acessing virtual field

I have a layer (my_layer) containing a virtual field (virtual_1). Next step I want to create a virtual layer, which list only unique values (as an bonus also dissolves the geometries by unique values).

The following query for the virtual layer does not work with virtual fields:

SELECT DISTINCT virtual_1 from my_layer 

How could the desired outcome be achieved?

Some notes/ideas:

  • I need an dynamic solution, as the data in "my_layer" gets updated reguarly. So unfortunately the Vector>Analysis>Unique Values is not an option. Also Dissolving by virtual field is therefore not an option.
  • Would it work to generate the virtual field inside the Query itself? How could an expression of the field editor evaluated in the virtual-field-query?

Virtual layer accessing virtual field

I have a layer my_layer containing a virtual field virtual_1. Next step I want to create a virtual layer, which list only unique values (as a bonus also dissolves the geometries by unique values).

The following query for the virtual layer doesn't work with virtual fields:

SELECT DISTINCT virtual_1 from my_layer 

How could the desired outcome be achieved?

Some notes/ideas:

  • I need an dynamic solution, as the data in my_layer gets updated reguarly. So unfortunately the Vector>Analysis>Unique Values isn't an option. Also Dissolving by virtual field is therefore not an option.
  • Would it work to generate the virtual field inside the query itself? How could an expression of the field editor evaluated in the virtual-field-query?
Source Link

Virtual layer acessing virtual field

I have a layer (my_layer) containing a virtual field (virtual_1). Next step I want to create a virtual layer, which list only unique values (as an bonus also dissolves the geometries by unique values).

The following query for the virtual layer does not work with virtual fields:

SELECT DISTINCT virtual_1 from my_layer 

How could the desired outcome be achieved?

Some notes/ideas:

  • I need an dynamic solution, as the data in "my_layer" gets updated reguarly. So unfortunately the Vector>Analysis>Unique Values is not an option. Also Dissolving by virtual field is therefore not an option.
  • Would it work to generate the virtual field inside the Query itself? How could an expression of the field editor evaluated in the virtual-field-query?