<div dir="ltr">Hi Andreas,<br><div><div class="gmail_extra"><br><div class="gmail_quote">2015-09-21 8:39 GMT+02:00 Andreas Neumann <span dir="ltr"><<a href="mailto:a.neumann@carto.net" target="_blank">a.neumann@carto.net</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Hi,<br>
<br>
So how is concat(NULL,fieldname) any better than
COALESCE(fieldname,''). To me it is the same complexity and not
really an improvement. But maybe I don't get it. The only slight
advantage would be that "concat" may be a more familiar term than
coalesce. But if you come from a database background you already
know COALESCE. Any serious GIS professional needs to know databases.<br>
<br></div></blockquote><div><div>Concatenate labels is a frequent question in GIS forums. Maybe we are not all _serious_ GIS professional but even QGIS _simple_ users should be able to easily concatenate labels without being puzzled by NULL values handling imho. <br></div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000">
Another small thing:<br>
Do not mix up double quotes (") and single quotes ('). Whenever you
use a string, do use single quotes, when you use an attribute either
use no quotes or double quotes for some providers if you use capital
letters in field names (which is discourage anyway).<span class=""><font color="#888888"><br>
<br>
Andreas</font></span><div><div class="h5"><br>
<br>
<div>On 20.09.2015 12:59, Matthias Kuhn
wrote:<br>
</div>
<blockquote type="cite">
Hi Phil,<br>
<br>
In addition to COALESCE I'd like to promote the use of the
function <b>CONCAT()</b> which treats NULL values as empty
strings (it was changed recently, it's probably since 2.10) what
makes it very handy.<br>
<br>
Example:<br>
<br>
NULL || "hello" -> NULL<br>
<br>
vs.<br>
<br>
CONCAT( NULL , "hello") -> "hello<br>
<br>
vs.<br>
<br>
COALESCE( NULL, "" ) || "hello" -> "hello"<br>
<br>
Cheers,<br>
Matthias<br>
<br>
<div>On 09/20/2015 09:54 AM, Phil (The
Geek) Wyatt wrote:<br>
</div>
<blockquote type="cite">
<div>
<p class="MsoNormal">Hi Folks,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I am working with LIST Address Points
data from <a href="http://listdata.thelist.tas.gov.au/opendata/" target="_blank">http://listdata.thelist.tas.gov.au/opendata/</a>
(Specifically Clarence Municipality) and I need to
concatenate into one field the full address of each
location. I am struggling to figure out how to do it when
there are fields for unit numbers, building names, numbers
to and from etc. Many of the fields are also NULL so clearly
I want those fields disregarded.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Can someone give me a quick heads up on
how to NOT add the data from a field that has NULL?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Chances are I will be doing this
regularly so I am keen to document the required expressions
for others to use as well.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span>Cheers
- Phil<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span>Volunteer
Mapper - <a href="http://www.redcross.org.au/volunteering.aspx" target="_blank"><span style="color:windowtext;text-decoration:none">Red
Cross</span></a><u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<br>
<fieldset></fieldset>
<br>
<pre>_______________________________________________
Qgis-user mailing list
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a></pre>
</blockquote>
<br>
<br>
<fieldset></fieldset>
<br>
<pre>_______________________________________________
Qgis-user mailing list
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a></pre>
</blockquote>
<br>
</div></div></div>
<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" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br></blockquote></div><br></div></div></div>