1

I'm using QGIS 3.34. I have a point layer that contains a single point showing a site location (called "Site Location"). I have a polygon layer covering the UK with 12km squares containing some attribute data I'm interested in (called "CDD"). I'm looking to set up a print layout with some labels that dynamically update and display the value of the polygon attribute "Value" based on the location of the site location point. How can I use an expression to acheive this? I've tried the following, but it says 'No feature was found on this layer to evaluate the expression.'

aggregate(
    'CDD',
    'first_value',
    "Value",
    filter:=intersects(
        $geometry,
        geometry(
            get_feature(
                'Site Location',
                'fid',
                1
            )
        )
    )
)
3

1 Answer 1

1

Solved it using the following:

aggregate(
    layer:='CDD',
    aggregate:='max',
    expression:="Value",
    filter:=contains($geometry, geometry(get_feature('Site Location', 'fid', 1)))
)

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.