[Qgis-user] CSV layer, Time column null expressie to test for NULL/empty?

Richard Duivenvoorde rdmailings at duif.net
Wed Jan 18 09:31:59 PST 2023


We have csv data, which is loaded as layer via the Delimited Text Layer provider.

The data contains both a date and a time column, which we have to format as isodatetime using an QGIS Expression.

BUT sometimes time column is empty/no value (in which case we have to format it as isoTIME only).

So we have to check IF the time column is empty, then only format the Date, else use Date AND Time.

My problem is that I fail to create an expression for the test IF the column (see screenshot) is empty.

I thought to use (our column is called "bezoek.begintijd"):

"bezoek.begintijd"  in ('', ' ', NULL)

BUT this does NOT return True or False, but NULL !!

But:


("bezoek.begintijd"  in ('', ' ', NULL)) = NULL
does ALSO NOT resolve to True... (also NULL)

When the record has no data (the csv holds no data for that record), it shows
<time: >
if it has data:
<time: 09:42:00>

Anybody an idea what test I can use to test if the time column (which is typed as Time) is empty/null/none?

Thanks for any pointers.

Regards,

Richard Duivenvoorde
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot from 2023-01-18 18-17-35.png
Type: image/png
Size: 19972 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20230118/139cbe52/attachment.png>


More information about the QGIS-User mailing list