Skip to main content
1 of 4
Babel
  • 74.9k
  • 15
  • 87
  • 227

Use this expression:

with_variable(
    'county',
    county_name,
    array_to_string(
        array_foreach(
            array_agg (
                city_name, 
                filter:="county_name"=@county
            ),
            @element 
            || ': '  || 
            attribute(
                get_feature(@layer,'city_name', @element),
                'people_ok'
            )  
            || ' % of people are OK and'  || 
            attribute(
                get_feature(@layer,'city_name', @element),
                'people_not_ok'
            )
            ||  ' % are not'
        ),
        delimiter:= '\n' 
    )
)
Babel
  • 74.9k
  • 15
  • 87
  • 227