Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Mac OSX 10.6.8 QGIS 1.8.0 : I've two columns in the attribute table, name, and name2 for those labels that need to be 2 lines; multiline labelling is checked. But when I use "name"||'\n'||"name2" I only get labels when there is a printable entry for both name and name2. Can you spot what I'm missing to show the 2nd line only for labels that need it?

share|improve this question

Thats possible only with QGIS Master at the moment:

"Strecke" || '-n' || CASE WHEN length( "Kilometer" ) > 0 THEN "Kilometer" ELSE ' ' END

You don't have the CASE statements in Lisboa.

share|improve this answer
Am I not correct that '' above is a null string? If so, I don't see why the case statement is needed when "Kilometer" is already null. – johnsankey Apr 3 '13 at 16:17
No, I used a single blank. A Null string seems to break the labelling. – AndreJ Apr 9 '13 at 8:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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