I am a novice GIS user and am just seeing the potential for relations in my work. A problem I've come across and would like a solution to it.

I have two stochastic matrices (risk matrices) that apply to trees - matrix 1 is the 'Likelihood matrix' and matrix 2 is the 'Risk rating matrix'.

I want my attribute editing form to be able to filter the choices from the columns to get the appropriate result.

The matrices look like this:

Risk assessment matrices

The workflow is that we assess the LOF (likelihood of failure), then the LOI (likelihood of impact) to get the LOFI (likelihood of failure and impact). The LOFI is then plugged into matrix 2, where its intersection with the COF (consequences of failure) results in a risk rating (RR).

Formulaically it may look like this: LOF + LOI = LOFI, LOFI + COF = RR

We do these assessments in the field, so use QField to collect information; therefore, the solution is most likely going to use the relation reference widget (and not the value relations widget, since that currently isn't supported in QField) using foreign keys.

I'm not understanding the relation reference but seemed to make some progress with the value relation widget. I made a SpatiaLite database containing tables for LOF, LOI, LOFI, COF and RR. For LOF and LOI, I made a foreign key that related them using filter expressions and then used the feature id (pkuid) of the LOI to code to the specific value of LOFI, also through a filter expression. See the images below to see how I did that.

Does anyone know how to: adapt this for the relation reference widget, and link the LOFI and COF tables to get the RR like I did for the LOFI?

LOF Table LOI Table LOFI Table

These are the value relations and filters for context.

Value Relation for LOF Value Relation for LOI Value Relation for LOFI


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.