[Qgis-user] calculating progressive value

DelazJ delazj at gmail.com
Sun Aug 14 08:18:36 PDT 2016


Hi,
unless the number of combinations is known and limited, using case when
function could become a nightmare.

QGIS 2.16 provides aggregates functions (
http://qgis.org/fr/site/forusers/visualchangelog216/index.html#feature-aggregate-support-for-expressions)
that I think would help to do this but I'm unable to find the right syntax,
if ever.

Regards,
Harrissou

2016-08-14 14:07 GMT+02:00 Christine <geo.guide at web.de>:

> Salvatore Oliveto wrote
> > Hi, I have a Qgis layer with a table with twno columns X and Y.
> > The X column has a set of values​​, while in the Y column I have to
> enter,
> > using field calculator, for each record the progressive value. Eg : X
> > column values: a , b , c , d ; Y column values (to be calculated with the
> > field calculator from Y column): a; a + b; a + b + c; a + b + c + d.
>
> Hi Salvatore,
> not really sure, if I understood you properly, but you can use a "case when
> ... then ... else" condition in field calculator. Please adapt the
> following
> pattern to your needs:
>
> CASE
> WHEN X = a THEN a
> WHEN X = b THEN a+b
> WHEN X = c THEN a+b+c
> WHEN X = d THEN a+b+c+d
> ELSE 'error value'
> END
>
> Hope this helps,
> regards, Christine
>
>
>
>
>
>
> --
> View this message in context: http://osgeo-org.1560.x6.
> nabble.com/calculating-progressive-value-tp5280693p5280699.html
> Sent from the Quantum GIS - User mailing list archive at Nabble.com.
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20160814/feeb08ee/attachment.html>


More information about the Qgis-user mailing list