I have several symbol layers:

current: "from" <= 1832 AND "to" > 1832
former: "from" <= 1832 AND "to" <= 1832
future: "from" > 1832

What I'd like to do is be able to change 1832 to another year without separately editing each rule. Ideally I'd be able to define a variable somewhere and refer to that variable in the rules.

I've found a workable solution by creating an extra column in the attribute table and filling it with 1832, then referring to that in the rules. It's easy to change with the field calculator, but is rather inelegant. I tried using a joined table and editing that instead, but it doesn't update the rendering properly when I save the table with a new year value.

Is there a better way to do this, or have I determined the optimal way?


Currently no, but that is a good idea I might be able to add it in 2.6.

Currently you have two optipns

  • new column and make your rule refer to this column. "From" = "date"
  • or you can make a custom function using Python, however this is overkil

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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