2

Our Foundation is adding additional properties to points.

If property1 = FOO , then add property2 = BAR

    WHEN
        property1 = 'FOO' THEN property2 = 'BAR'
    END

When I run this the property1 column is deleted. Can you help me with the syntax, here, please?

Assumptions/Knowns: This is a spatialite layer. property1 and property2 columns both exist. I am using QGIS 2.4. I opened the attributes tables to use the Expression dialog. The property1 column is selected when the expression is executed. property1 and property2 are columns, and I am aware that " is sometimes used to enclose columns. I do need to store these values for use in other programs where they cannot be so easily derived from the data.

I saw several examples that changed the current value of property1: WHEN property1 = A THEN 1 but this only changes the value in the query column, and I am looking to insert another value property2 based on the value of property1.

1

Have you checked and selected the correct target field = "property2" for "update selected field"?

enter image description here

no need to set update field in syntax.

try the below syntax.

CASE
   WHEN  "property1" = 'FOO' THEN 'BAR'
END

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.