I am using QGIS 3.22. I wish to add a field that will represent X,Y or Lat Lon values I managed to create a field for X (using $X) and a field for Y (using $Y) but how do I combine them to one field like this: 177852,655321
2 Answers
You need a string
type field, and you need to use pipes (||
), like
$x||','||$y
$x
and $y
you already know, and the pipes concatenate characters. The output could be an integer value, or you can chime in a comma (','
) in between to get the notation you want.
A widely used alternative is:
Concat ($x, ',', $y)
concat : https://docs.qgis.org/3.22/en/docs/user_manual/expressions/functions_list.html#concat