[Qgis-user] SQL Expressions

Nathan Woodrow madmanwoo at gmail.com
Mon Mar 30 05:20:18 PDT 2015


Double quote is a field reference, single quote is a string.  Functions
normally take a string for a field name, if you use "fieldname" that means
value of fieldname.

On Mon, 30 Mar 2015 at 22:07 Junior Delaz <delazj at gmail.com> wrote:

> Hi,
> Niccolo, Nathan is right. his proposal is the simplier and recommanded.
> But I think your formulae should work if you write
> $atlasfeatureid || '_' || attribute($atlasfeature, 'name' ).
> Only simple quote ' and not " near the field's name inside attribute
> function brackets.
>
> By the way, can someone explain me why for some functions (attribute,
> getFeature), you need to use simple quote for the fields and double
> quotes when using other functions ?
> And when you double-click on field's name, they are always appended to
> your expression with double quote. Can this be standardised ?
>
>
> 2015-03-30 12:02 GMT+02:00 Nathan Woodrow <madmanwoo at gmail.com>:
>
>> You don't need to use the attribute function to get the current feature
>> fields, just use the field name:
>>
>> 'output_'||  "name"
>>
>> "id" ||  "name"
>>
>> On Sat, 28 Feb 2015 at 01:59 Niccolò Marchi <sciurusurbanus at hotmail.it>
>> wrote:
>>
>>>  Hi all,
>>> I'm having some problems with the new atlas SQL features and I feel like
>>> a dumb.
>>> before 2.6 I've been able to set the output name such as "feature id _
>>> feature name", but I can't understand (or make it work) with the new
>>> functions $atlasfeature and $atlasfeatureid.
>>> indeed, once started with the atlas production, a temporary image is
>>> created and then overwritten, leaving me with nothing.
>>>
>>> I tried with:
>>>
>>> $atlasfeatureid || '_' || attribute($atlasfeature, "name" )
>>>
>>> and then
>>>
>>> attribute( $atlasfeature, "id" ) || '_' || attribute( $atlasfeature,
>>> "name" )
>>> ("id" is a numeric field within the table)
>>>
>>> any suggestion?
>>>
>>>
>>> thank you in advance!
>>> all the best,
>>>
>>> Nic
>>>
>>>
>>> ------------------------------
>>>    <http://www.avast.com/>
>>>
>>> This email is free from viruses and malware because avast! Antivirus
>>> <http://www.avast.com/> protection is active.
>>>
>>>  _______________________________________________
>>> Qgis-user mailing list
>>> Qgis-user at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/qgis-user
>>
>>
>> _______________________________________________
>> Qgis-user mailing list
>> Qgis-user at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-user
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20150330/4f698571/attachment.html>


More information about the Qgis-user mailing list