Hi,<br>The issue resides in the use of || operator, which doesn't handle null values: if any of the concatenated items is null then the result returns null. In this case, better use the concat function. Something like below should work (untested, though)<br><br>Case when  "signifcant"  = 'yes' <br>Then<br> concat( title( "Name" ), '\n',<br>  Case when "Cu_e_t" <1 Then '' Else round("Cu_e_t"/1000,0) || 'Kt Cu ' End,<br>  Case when "Pb_e_t" <1 Then '' Else round("Pb_e_t"/1000,0) || 'Kt Pb' End<br> )<br>Else null -- I think it's not really needed<br>End<br><br>See <a href="http://docs.qgis.org/2.14/en/docs/user_manual/working_with_vector/vector_properties.html#define-labels-based-on-expressions">http://docs.qgis.org/2.14/en/docs/user_manual/working_with_vector/vector_properties.html#define-labels-based-on-expressions</a> for some sample of labeling code<br><br>Hope that helps,<br>Harrissou<br><br>Le mercredi 21 décembre 2016, damos <<a href="mailto:damien.stephens@gmail.com">damien.stephens@gmail.com</a>> a écrit :<br>> HI I am trying to do a nested case statement for a labelling task.<br>> I have a list of mines of varying sizes with different commodities and would<br>> like to label with the name of the mine and the amount of each commodity at<br>> the mine in a new line below the name. I only want to label the mines that I<br>> have decided are signifcant and for this I have made a new column in my<br>> table called significant.<br>> My difficulty is that not all mines have the same commodities, for example<br>> one mine has copper (Cu) and no lead(Pb), while another has both. yet<br>> another will only have Pb.<br>> i can easily label all of the sigificant mines and their copper amoutns with<br>> a suffix of kt Cu using this code:<br>><br>> case when  "signifcant"  = 'yes' then  title( "Name" ) ||   '\n'   ||   case<br>> when "Cu_e_t" <1 then '' else round("Cu_e_t"/1000,0) || 'Kt Cu' end else<br>> null end<br>><br>> however if I then try to add in the Pb amounts like this;<br>> case when  "signifcant"  = 'yes' then  title( "Name" ) ||   '\n'   ||   case<br>> when "Cu_e_t" <1 then '' else round("Cu_e_t"/1000,0) || 'Kt Cu' end ||<br>> case when "Pb_e_t" <1 then '' else round("Pb_e_t"/1000,0) || 'Kt Pb' end<br>> else null end<br>><br>> I lose all of the Cu only mines and only get labels for those with Cu and Pb<br>> or just Pb.<br>> I understand that I am doing something wrong with the nested case<br>> statements, but cant figure out what.<br>><br>> any help would be much appreciated.<br>> int the mean time I am going back to do the formula in excel where I am<br>> capable.<br>><br>><br>><br>><br>> --<br>> View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/using-nested-case-statements-in-labelling-tp5300779.html">http://osgeo-org.1560.x6.nabble.com/using-nested-case-statements-in-labelling-tp5300779.html</a><br>> Sent from the Quantum GIS - User mailing list archive at Nabble.com.<br>> _______________________________________________<br>> Qgis-user mailing list<br>> <a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br>> List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>> Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a>