I want to highlight parts of a map based on the page number in an atlas. Ideally I'd use the expression builder in the layer style menu to set the Column to equal the atlas page number.

My expression is as follows

@atlas_pagename  || '_1' 

The page number is "1007" and the column is "1007_1" hence the need to add the _1 at the end. The next column is 1008_1 for example.

The expression successfully outputs 1007_1, but the expression builder doesn't recognise this as the name of a column.

Is there any way to make the expression builder not just output "1007_1" as a string, but to select the column "1007_1"?

I am trying to do this automatically with an expression so that when the atlas moves onto page 1008 the layer will move onto column 1008_1 and so on.

  • 1
    can you try something like attribute($atlas_feature, @atlas_pagename || '_1' ) ..?
    – Steven Kay
    Dec 13, 2017 at 20:07

2 Answers 2


I think eval() is what you're looking for, i.e.:


The string in the brackets would be "1008_1", which should be evaluated as the attribute value in column 1008_1.

  • My pleasure. The greatest way to say thank you is accepting an answer... ;-) Dec 15, 2017 at 11:12
  • 3
    Ed - thanks for sharing, and Jochen thanks for providing the solution. I thought it would be useful to blog the method with examples and I've also shared a project file for people to play around with: statsmapsnpix.com/2019/01/qgis-atlas-by-field.html Jan 2, 2019 at 8:25

You may add the column/field name from the Fields and Values option:

enter image description here

@atlas_pagename  || '_' || "columnFieldName"
  • 1
    Thank you, but I should have clarified that I want it to move along to the next column with the next atlas page. So when I move the atlas to Page Name 1008 or 1009, the layer moves along with it to Column 1008_1 or 1009_1. If I just select from the list as you suggest, it'll stay stuck on 1007. Dec 13, 2017 at 13:58

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.