13

This question already has an answer here:

Is it possible to show 2 or more labels for 1 layer? For example - 1 label will show the name of a school and the 2nd label will show the number of students? They should be completely different labels. Editing one label (its buffer, font, background etc.) will not affect the other labels.

Thanks

marked as duplicate by underdark Jan 21 '14 at 18:36

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • I don't really agree with you @underdark as the question is: ...1 label will show the name of a school and the 2nd label with show the number of students... I asked myself the same question wich is not: how to get a multiple-lines label (by means of concatenation)? So here is my question: is it possible to display 2 separated labels for one point from one sible layer? Thanks! – wiltomap Mar 9 '15 at 15:34
  • Feel free to open a new thread which explains exactly how your use case differs from what is described in the linked question. It shows how to create a label from multiple fields which can be adapted to show name and number of students. – underdark Mar 9 '15 at 17:48
  • The only way I can think to do this would be to make a dummy layer, format it so you can't see the dummy layer, then label the first layer with 'school', the second (invisible layer) with '# students'. You can then choose a different style of font etc for each layer's label. Might need to offset them specifically though, and that will take some fiddling around. – Amroco Jun 21 '17 at 23:30
22

here is a link for multi line labels. The syntax is like:

Field1 || '\n' || Field2

with \n for new line

Make sure you use a backslash '\' instead of a forward slash '/'.

13

In the menu layer labelling you can press on the "E"-symbol and then create a combination of different labels.

Showing school and number of student should look something like this:

    "Name of School" || ', ' || "Number of students"

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