I have basic (maybe a little more) knowledge of databases and GIS.

I study Archaeology and for my thesis I am designing a local database in QGIS (consist of shapefiles with their relationships). I have to prototype the design and test it in a GIS. Since the database is for managing Dutch archaeological projectdata (not to confuse with excavation data), each shapefile contain the fieldnames "province" and "town" so we can locate the project. We can conclude that one province has many towns. I want the field "town" depend on field "province".

There are some issues... I made a .csv file with 2 fields "Value" and "Description" as like in QGIS Value Map widget. Value contains all the provinces and description the towns. In Value Relation widget in QGIS I get the province multiple times in the field. Both 'key column' and 'value column' is the value (province) of the .csv file. I would like to see each province name once.

Second, if I choose province A in field "province", I would like to see the towns of province A in field "town" and not all towns of province A,B,C...

Did I made my .csv file on a wrong way?

Or do I have to write an expression?

Which I tried, but I could not manage it to work... As I said I am an Archaeology student, not an ICT student. The first picture shows a part of my .csv in excel. The second shows what I did in the Value Relation widget. The third shows that I get all the provinces multiple times and the last shows that I get all towns (of all provinces).

First: part of the .csv file enter image description here enter image description here enter image description here

Your Answer

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

Browse other questions tagged or ask your own question.