Hi Andrew,<div><br></div><div>Just so you are aware the correct thing to use to join strings is || (double pipe).  + is only for addition and can lead to unexpected results.</div><div><br></div><div>eg</div><div><br></div>

<div><meta http-equiv="content-type" content="text/html; charset=utf-8">stringField || '\n (' || decimalField || ' some text'</div><div><br></div><div>|| Will also convert non strings to strings so no need to cast. </div>

<div><br></div><div>- Nathan<br><br><div class="gmail_quote">On Mon, Oct 24, 2011 at 12:23 AM, Andrew Chapman <span dir="ltr"><<a href="mailto:andrew.chapman@donkagen.co.uk">andrew.chapman@donkagen.co.uk</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I'm trying to combine multiple attributes into a single multi-line<br>
equivalent to use as a label in a shapefile.<br>
I create and populate a new attribute using the field calculator using an<br>
expression like:<br>
  stringField + '\n' + '(' + to string(decimalField) + ' some text'<br>
This successfully creates a multi-line string in the target field PROVIDED<br>
THAT I DON'T SAVE THE FILE. I can then use the new symbology text to display<br>
the expected label.<br>
If I save the layer, the multi-line string is truncated to the first line<br>
only and the displayed label reverts to the first line.<br>
The multi-line string therefore isn't saved. Is this a limitation of<br>
shapefiles or is it a bug?<br>
If it is a limitation of shapefiles, is there any other way to achieve the<br>
same effect?<br>
<br>
Andrew<br>
<br>
<br>
_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
</blockquote></div><br></div>