[Qgis-user] Case

Andreas Neumann a.neumann at carto.net
Thu Aug 23 23:26:04 PDT 2018


Hi Edisson,

Not sure if you are really using QGIS? The screenshot you pasted from 
the attribute table seems to be from another GIS (ESRI?).

Anyway - your CASE statement is wrong - no matter if it concerns QGIS or 
ESRI, you cannot have several tests, separated by Kommas. Either you 
have to combine the tests with AND/OR or you have to use the IN/NOT IN 
statements, e.g. like

CASE
   WHEN val IN (1,3,5,7) THEN 'odd'
   WHEN val IN (2,4,6,8) THEN 'even'
END

The syntax you used is invalid.

Hope this helps, no matter what GIS is concerned ;-)

Greetings,

Andreas


Am 23.08.2018 um 22:04 schrieb Eddison Araya:
> Hello, greetings, a question:
>
> image.png
>
> If I have that map: 
> *https://www.dropbox.com/s/6hvnrb37fvc00wl/ejemplo.zip?dl=0 *
>
> E eu quero dizer:
>  Se W_BRILLO is equal to 3, se W_PPT is equal to 1, se W_TEMP is equal 
> to 2, have a value of  2
>
> Se W_BRILLO   is equal to    2, se W_PPT is equal to    2, se W_TEMP 
> is equal to   3, have a value of 2
>
> Se W_BRILLO  is equal to    1, se W_PPT is equal to    2, se W_TEMP is 
> equal to    3, have a value of 3
>
> I put this:
>
> CASE
>
> WHEN "W_BRILLO" = '3', "W_PPT" ='1', "W_TEMP" = '2' THEN 2
> WHEN "W_BRILLO" = '2', "W_PPT" ='2', "W_TEMP" = '3' THEN 2
> WHEN W_BRILLOI = '1', "W_PPT" ='2', "W_TEMP" = '3' THEN  3
>
>  END
>
>
> But I get an error!
>
> Thank you
>
> Eddison
>
>
> _______________________________________________
> 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/20180824/ed17e610/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 7944 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20180824/ed17e610/attachment.png>


More information about the Qgis-user mailing list