<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body dir="auto"><div dir="auto">You can also use</div><div dir="auto">CASE</div><div dir="auto">When field is null then 123</div><div dir="auto">else 321</div><div dir="auto">end</div><div dir="auto"><br></div><div dir="auto">Kirk Schmidt</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><br></div><div id="composer_signature" dir="auto"><div style="font-size:85%;color:#575757" dir="auto">Sent from my Galaxy</div></div><div dir="auto"><br></div><div><br></div><div align="left" dir="auto" style="font-size:100%;color:#000000"><div>-------- Original message --------</div><div>From: Richard Duivenvoorde via QGIS-User <qgis-user@lists.osgeo.org> </div><div>Date: 2023-01-18 1:44 p.m. (GMT-04:00) </div><div>To: qgis-user@lists.osgeo.org </div><div>Subject: Re: [Qgis-user] CSV layer,
Time column null expressie to test for NULL/empty? </div><div><br></div></div>Pff, ok found a solution:<br><br>"bezoek.begintijd" IS NULL<br><br>works<br><br>So if I want to test for empty strings, or NULL (like strings), AND real NULLS, I use now:<br><br>( "bezoek.begintijd" IS NULL OR "bezoek.begintijd" in ('', ' ', 'NULL') )<br><br>Regards,<br><br>Richard Duivenvoorde<br><br>On 1/18/23 18:31, Richard Duivenvoorde via QGIS-User wrote:<br>> We have csv data, which is loaded as layer via the Delimited Text Layer provider.<br>> <br>> The data contains both a date and a time column, which we have to format as isodatetime using an QGIS Expression.<br>> <br>> BUT sometimes time column is empty/no value (in which case we have to format it as isoTIME only).<br>> <br>> So we have to check IF the time column is empty, then only format the Date, else use Date AND Time.<br>> <br>> My problem is that I fail to create an expression for the test IF the column (see screenshot) is empty.<br>> <br>> I thought to use (our column is called "bezoek.begintijd"):<br>> <br>> "bezoek.begintijd" in ('', ' ', NULL)<br>> <br>> BUT this does NOT return True or False, but NULL !!<br>> <br>> But:<br>> <br>> <br>> ("bezoek.begintijd" in ('', ' ', NULL)) = NULL<br>> does ALSO NOT resolve to True... (also NULL)<br>> <br>> When the record has no data (the csv holds no data for that record), it shows<br>> <time: ><br>> if it has data:<br>> <time: 09:42:00><br>> <br>> Anybody an idea what test I can use to test if the time column (which is typed as Time) is empty/null/none?<br>> <br>> Thanks for any pointers.<br>> <br>> Regards,<br>> <br>> Richard Duivenvoorde<br>> <br>> _______________________________________________<br>> QGIS-User mailing list<br>> QGIS-User@lists.osgeo.org<br>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user<br>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user<br><br>_______________________________________________<br>QGIS-User mailing list<br>QGIS-User@lists.osgeo.org<br>List info: https://lists.osgeo.org/mailman/listinfo/qgis-user<br>Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user<br></body></html>