Label writing an expression with text preceding a field

9 views
Skip to first unread message

Ia...@jcis.net.au

unread,
Jan 21, 2026, 11:34:16 PM (17 hours ago) Jan 21
to australian-qg...@googlegroups.com

I have a layer with site locations numbered 1 to 49.

 

I would like to label these Site 1 to Site 49 but I cannot find out how to do this in the QGIS manual. I think it is writing an expression with text preceding a field is what I need but I am not sure what language it would be in. Can anyone give me tips of point me in the right direction.  

 

Cheers

 

Dr Iain Stuart

JCIS Consultants

 

P.O. Box 2397

Burwood North

NSW, 2134


(0413) 380116 (m)

 

Jacqueline Mallinson

unread,
1:00 AM (16 hours ago) 1:00 AM
to QGIS Australia User Group
I'm sure someone has already responded but you can open up the layer properties, head to the labels tab:
image.png

Click the little expression button to the right of the value bar which will open the following:
image.png
  •  in here type text you want in single apostrophes in your case 'Site ' note I have included a space you don't have to. 
  • Then the button showing two vertical lines
  • followed by the field your numbers are in but in double apostrophes e.g  "numbers" and that will add the value of that field to the label.
Hope that was clear enough,

Good Luck,

Jacqueline

Michael Cushen

unread,
1:00 AM (16 hours ago) 1:00 AM
to australian-qg...@googlegroups.com
Hi Iain,

I'm guessing you want to create a visual label with both input text elements as well as field elements?
If your field was called "name" for example, we could do the following in the label expression builder:
'Site ' || "name"

The type of quotation marks are important. Double quotation marks for fields, single quotation marks for text.
The double pipe || is acting to join both together; we could do this with a function either if we want to allow null values from the field, e.g.: concat('Site ',"name").
image.png

See video example attached also.

Michael

--
You received this message because you are subscribed to the Google Groups "QGIS Australia User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to australian-qgis-use...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/australian-qgis-user-group/001201dc8b58%244799ffd0%24d6cdff70%24%40jcis.net.au.
TextLabel.mp4

Jacqueline Mallinson

unread,
1:00 AM (16 hours ago) 1:00 AM
to australian-qg...@googlegroups.com
I'm sure someone has already responded but you need to open up the layer properties, head to the labels tab:
image.png

Click the little expression button to the right of the value bar which will open the following:
image.png
  •  in here type text you want in single apostrophes in your case 'Site ' note I have included a space you don't have to. 
  • Then the button showing two vertical lines
  • followed by the field your numbers are in but in double apostrophes e.g  "numbers" and that will add the value of that field to the label.
Hope that was clear enough,

Good Luck,

Jacqueline
--

Andy Tice

unread,
1:59 AM (15 hours ago) 1:59 AM
to Unname
Hi,
Do the sites have a unique id column?
Simplest way could be to copy those into Excel, then use another column for the labels you want.
Save as a .CSV, open up in q and join to the spatial file on id.
No expression required.

Ia...@jcis.net.au

unread,
4:08 AM (12 hours ago) 4:08 AM
to australian-qg...@googlegroups.com

Thanks everyone It works!

 

Cheers

 

Dr Iain Stuart

JCIS Consultants

 

P.O. Box 2397

Burwood North

NSW, 2134


(0413) 380116 (m)

 

From: australian-qg...@googlegroups.com <australian-qg...@googlegroups.com> On Behalf Of Andy Tice
Sent: Thursday, 22 January 2026 5:59 PM
To: Unname <australian-qg...@googlegroups.com>
Subject: Re: [QGIS-Australia-User-Group] Label writing an expression with text preceding a field

 

Hi,

Do the sites have a unique id column?

Simplest way could be to copy those into Excel, then use another column for the labels you want.

Save as a .CSV, open up in q and join to the spatial file on id.

No expression required.

 

On Thu, 22 Jan 2026, 17:00 Jacqueline Mallinson, <jmal...@gmail.com> wrote:

I'm sure someone has already responded but you need to open up the layer properties, head to the labels tab:

 

Click the little expression button to the right of the value bar which will open the following:

image001.png
image002.png
Reply all
Reply to author
Forward
0 new messages