I am mapping out the electrical grid infrastructure of my country. I have a Substations layer (with fid and name fields) and a Existing_Lines layer (with fid, substation_start, substation_end and label layers.
substation_start and substation_end represent the nodes to which the power line connects, so the example in the attached image shows the power line starting at "Botesland" substation and ending at "Welterede" substation. Both fields are related to the Substations layer as shown below (rows 11 and 12).
I want to include the field label as a label to display on the map next to the power lines showing the route of the power line. The label of the example should display "Botesland - Weltevrede" but when I use the expression concat("substation_start", " - ", "substation_end")
in the calculator for the label field in the Existing_Lines layer, QGIS returns the string 1 - 2
as a value in the field.
I understand why it's doing this - the fields substation_start and substation_end contain integers with the fid value of the features it references in the Substations layer...
Therefore, I need an expression that will "Lookup" the value in the name field for the fid of the feature on the other layer...
Can anyone please help me find the right expression?