I'm struggling to include the field data from a double type attribute in a label.
I've managed fine to pull in the data from the "Code" and "Features & Remarks" columns... I also wanted to encase the "Code" field in parentheses followed by a space, so used the following;
'('+"Code"+') '+"Features & Remarks"
Which also works fine when the latter column is empty. Both columns are QStrings.
Now I'm also trying to pull data in from another column "Depth of Burial" which is a double type. As a note, either "Depth of Burial" or "Features & Remarks" is always NULL - they never both have data in a given row, but often both are NULL.
'('+"Code"+') '+"Depth of burial [m]"+"Features & Remarks"
gives me no labels anywhere.
'('+"Code"+') '+(coalesce("Depth of burial [m]","Features & Remarks"))
only gives me labels where there is data in "Features & Remarks".
'('+"Code"+') '+(coalesce("Depth of burial [m]","Features & Remarks",' '))
displays all labels correctly EXCEPT rows with "Depth of Burial" data - they have no label.
I have also tried concatenate and if statements. The only way I could display the "Depth of Burial" column data was to either call it on its own or in the following;
if("Depth of burial [m]"=NULL,'('+"Code"+') '+"Features & Remarks","Depth of burial [m]")
However this one did not show any labels other than the "Depth of Burial" values.
My ideal aim to generate labels that are all prefixed with the "Code" column in parentheses then contain either the "Depth of Burial" value or the "Features and Remarks" column depending on which has data for a given row.