I'm trying to create labels for features, based on the value (or missing value) of three different columns and combinations can be possible.
I have three columns: Veg_dom, Veg_codom and Veg_onderg.
When all three columns have a value for a feature, I want the label to be as follows:
Veg_dom$value + Veg_codom$value + (Veg_onderg$value)
.
Other possibilities should be
Veg_dom$value + Veg_codom$value & Veg_dom$value + (Veg_onderg$value)
.
I use the following expression in the label expression window:
The labels however show as follows:
The only one correct is the first statement if all three columns have values.
Am I doing something wrong? Are nested IF
statements allowed?
Expression:
if( Veg_codom <> ' ' AND Veg_onderg <> ' ',
Veg_dom + '+' + Veg_codom + '+' + concat('(', Veg_onderg, ')'),
if( Veg_codom = ' ' AND Veg_onderg <> ' ',
Veg_dom + '+' +concat('(', Veg_onderg, ')'),
if( Veg_codom <> ' ' AND Veg_onderg = ' ',
Veg_dom + '+' + Veg_codom,
Veg_dom)))
Cels hold character-data: