2

I have a shape file with points at evenly spaced intervals, the table has the following fields: Name is up to 32 characters of text. it is currently populated with an eight digit number.

Point_No is an integer field which has the same eight digit number that is in the Name field.

What I would like to do is to only label the points that have the Name field or the Point_No field which end with the number "5"

I have tried case statements, substr statements, I have tried to use the modulus with the Point_No field, but I keep getting parsing errors.

5

I'd label the entire layer using whichever field you'd like. Then, in the Labels -> Rendering tab, look for the "Show label" control. Click that button and select "Edit". Enter an expression along the lines of:

right( "Point_No", 1 ) = 5

This should only display labels for features where Point_No ends with a 5.

4

I suggest another way to solve your problem. In the "Expression dialog" of the "layer labeling setting" use this expression:

CASE 
WHEN  tostring(  "Point_No" ) LIKE '%5' 
THEN  "Point_No"  
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.