1

I am self taught.

I have 3 layers on my map: Retailer, Producer and Processor. Each business in each of these categories has a unique identifier, their license number.

I have a CSV file with a list of all sales between Processor and retailer. The problem is that for every transaction there is a new line in the CSV file.
So if A processor sold to 15 retailers then each sale relationship has a line (including the unique license number for the processor) so when I relate this table only to the processor layer it only adds the first sale. I want to be able to show all retailers that the particular processor sold too.

processor to retail sales

The next request is is there a way to, once the above is completed, to select a processor on the map and have all of the retailers sold to show up and no other retailers?

1

First request: It sounds like you are using the 'Join' function in the layer properties. You actually need to go into Project>Project Properties>Relations to view 1:n relationships. This enables you to select a feature and in the form that pops up you will have a sub table with all the retailers. Joins only work 1:1.

Second request: You may need to create a custom function to query the relation and return a value if >0 records are returned. Then you can use this function in a rule based symbology.

Alternatively put the dataset and the CSV file in an SpatiaLite database and create a view that has true/false for if a record from one table has a record from another. Then join this view to the table and symbolise on the joined field.

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.