I am trying to filter an attribute table in QGIS Print Composer based on the current active atlas feature:
I have a table with an "id" column with and some records that have these values in the "id" column:
048-
048-1
048-2
048-2i
048-2ii
My current atlas feature is 048-2 (i.e. @atlas_feature, 'ref' evaluates to "048-2")
I'd like the table to filter (show) only the records that contain "048-2" and may contain more characters after it, so it should filter to this:
048-2
048-2i
048-2ii
If I use the expression:
"id" LIKE attribute ( @atlas_feature, 'ref' )
I only get "048-2" which makes sense.
Filtering by
"id" LIKE '048-2%'
gets the results I need.
But how can I filter this table according to my need by using attribute ( @atlas_feature, 'ref' ? – or, where to put the "%" in the following expression?
"id" LIKE attribute ( @atlas_feature, 'ref' )