I have two layers; one is the foreground and the other a background. Both layers have fields containing similar values (field values in the foreground layer (mun_code
) is also present in the background layer's fields (ADM3_PCODE
). For instance, both fields may contain the value 012802000
).
For the background layer, I am trying to use Rule-based styling to add a thicker border using the expression:
@mun_code = attribute( $currentfeature, 'ADM3_PCODE' )
but @mun_code
returns NULL
(most likely because mun_code
as a field is only present in the foreground layer while the background layer contains the field ADM3_PCODE
):
I already Generated an atlas choosing the foreground layer as the Coverage layer. My understanding is that $currentfeature
(in the code above) is already automatically controlled by the Print Composer Atlas, so I am wondering why it returns NULL
.
How can I fix this?
1 Answer 1
@ is for QGIS integrated reserved variables ... i think u meant "mun_code" (keeping the double quotes) to reference the attribute value ... But your aim remains unclear to me : Did u build any relation between the two tables ? Relation based on attributes (has any join been setup ?) or based on geography ? If u want to test the content of an attribute located in another table you have to define a clear relation.
-
Thanks. I did a table join, and also used double quotes but no difference. I think the main problem is like in this question: gis.stackexchange.com/questions/290844/… but the answers did not do any difference neither.JAT86– JAT862019年03月23日 10:39:07 +00:00Commented Mar 23, 2019 at 10:39
Explore related questions
See similar questions with these tags.
"ADM3_PCODE" = attribute( @atlas_feature , 'mun_code')
for feature of interest and another rule "ELSE" for features of no interest on the background layer.