[Qgis-user] Rank based on attributes for field

DelazJ delazj at gmail.com
Thu Jul 25 14:04:36 PDT 2019


Hi,
Depending on the version you are running (i don't know if all the functions
are in 3.4, otherwise you have the "array plus" - I think- plugin),
*array_find(
array_reverse( array_agg( "$area",order_by:= "$area") ), "$area") +1 *might
do the trick
array_agg will create a "list" of the features surface in your dataset,
ordered from the smallest to the largest
array_reverse is obvious I think
and array_find will return the order in which the current feature's area
appears in the list. The index is 0 based.

Hope that helps,
Harrissou

Le jeu. 25 juil. 2019 à 17:09, GILLEN Finbar <finbar.gillen at axa.ie> a
écrit :

> Hi,
>
>
>
> I'd like to create a new field in the attribute table which gives the rank
> of a polygon based upon a figure in another field.
>
>
>
> For example, the polygon of the largest figure would be rank 1 and the
> smallest rank N.
>
>
>
> Is there any way to do this.. can’t see a function in the field calculator.
>
>
>
> Regards
>
> Finbar
> *********************************************************************
>
> The contents and any attachments of this electronic mail message are
> confidential and intended only for the named addressees. Dissemination,
> forwarding, publication or other use of the message or attachments by any
> unauthorised person is strictly prohibited.
>
> Unless stated to the contrary, any opinions expressed in this message are
> personal and may not be attributed to AXA Insurance dac or any member of
> the AXA Group of Companies.
>
> AXA Insurance dac is regulated by the Central Bank of Ireland. For
> business in Northern Ireland, AXA Insurance dac is authorised by the
> Central Bank of Ireland and subject to limited regulation by the Financial
> Conduct Authority. Details about the extent of our regulation by the
> Financial Conduct Authority are available from us on request. AXA Insurance
> dac is a private company limited by shares, registered in Ireland number
> 136155. Registered Office Wolfe Tone House, Wolfe Tone Street, Dublin 1.
>
> "AXA Supporting Road Safety in Ireland"
>
> Internet e-mails are not necessarily secure. AXA Group does not accept
> responsibility for changes made to this message after it was sent. To help
> promote the use of electronic documents and to be kinder to the
> environment, please consider whether you really need to print this
> email.
>
> *********************************************************************
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20190725/c359ff0b/attachment.html>


More information about the Qgis-user mailing list