I think you need a CASE statement, which will allow you to have different conditions.
WHEN Veg_codon <> '' AND Veg_ondeg <> '' THEN Veg_dom + Veg_codom + '('+Veg_onderg+')'
WHEN Veg_codon <> '' AND Veg_ondeg = '' THEN Veg_dom + Veg_codom + '(some default value)'
WHEN Veg_codon = '' AND Veg_ondeg <> '' ...
The filter expression requests a true/false output. The function array_distinct() gives you an array with distinct values as an output, plus you need to use array_agg first, as @etrimaille pointed out. To get a true/false you can try something like:
"id" = array_first( array_agg( "id", group_by:= "cab_no."))
For id you have to ...
Great thing about data defined override is that you may not only use a column, but also any valid expression producing valid values for the thing you like to override (this is either or, if you add an expression, you needn't add a column, and vice versa). Simply click the override button, go to edit and enter the following:
WHEN "override column&...
This can be achieved using an agregate function. In this case the expression is:
Two notes on this. (1) Most of the credit goes to Ujaval Gandhi thanks to this blog entry. (2) I find it a bit counter-...
If you're working with "font markers" for your text, set the following for data defined override of the rotation:
This checks, whether the line is "flipped" and if it is, tells the symbology to rotate the text by 180 degrees, otherwise it stays, as it is.
I did some additional testing, ...