Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

1 Answer 1

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. –  Andre Joost Apr 9 '13 at 8:14

Your Answer

 
discard

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.