Re: [Qgis-user] CSV layer, Time column null expressie to test for NULL/empty?
Or: coalesce(field, '') in ('', ' ', 'NULL') Raymond On 19-01-2023 09:53, kirk via QGIS-User wrote: You can also use CASE When field is null then 123 else 321 end Kirk Schmidt Sent from my Galaxy Original message From: Richard Duivenvoorde via QGIS-User Date: 2023-01-18 1:44 p.m. (GMT-04:00) To: qgis-user@lists.osgeo.org Subject: Re: [Qgis-user] CSV layer, Time column null expressie to test for NULL/empty? Pff, ok found a solution: "bezoek.begintijd" IS NULL works So if I want to test for empty strings, or NULL (like strings), AND real NULLS, I use now: ( "bezoek.begintijd" IS NULL OR "bezoek.begintijd" in ('', ' ', 'NULL') ) Regards, Richard Duivenvoorde On 1/18/23 18:31, Richard Duivenvoorde via QGIS-User wrote: > 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 > > if it has data: > > > 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 > > ___ > QGIS-User mailing list > QGIS-User@lists.osgeo.org > List info: https://lists.osgeo.org/mailman/listinfo/qgis-user > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user ___ QGIS-User mailing list QGIS-User@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user ___ QGIS-User mailing list QGIS-User@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user ___ QGIS-User mailing list QGIS-User@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] CSV layer, Time column null expressie to test for NULL/empty?
You can also useCASEWhen field is null then 123else 321endKirk SchmidtSent from my Galaxy Original message From: Richard Duivenvoorde via QGIS-User Date: 2023-01-18 1:44 p.m. (GMT-04:00) To: qgis-user@lists.osgeo.org Subject: Re: [Qgis-user] CSV layer, Time column null expressie to test for NULL/empty? Pff, ok found a solution:"bezoek.begintijd" IS NULLworksSo if I want to test for empty strings, or NULL (like strings), AND real NULLS, I use now:( "bezoek.begintijd" IS NULL OR "bezoek.begintijd" in ('', ' ', 'NULL') )Regards,Richard DuivenvoordeOn 1/18/23 18:31, Richard Duivenvoorde via QGIS-User wrote:> 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> > if it has data:> > > 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> > ___> QGIS-User mailing list> QGIS-User@lists.osgeo.org> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user___QGIS-User mailing listQGIS-User@lists.osgeo.orgList info: https://lists.osgeo.org/mailman/listinfo/qgis-userUnsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user___ QGIS-User mailing list QGIS-User@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] CSV layer, Time column null expressie to test for NULL/empty?
Pff, ok found a solution: "bezoek.begintijd" IS NULL works So if I want to test for empty strings, or NULL (like strings), AND real NULLS, I use now: ( "bezoek.begintijd" IS NULL OR "bezoek.begintijd" in ('', ' ', 'NULL') ) Regards, Richard Duivenvoorde On 1/18/23 18:31, Richard Duivenvoorde via QGIS-User wrote: 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 if it has data: 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 ___ QGIS-User mailing list QGIS-User@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user ___ QGIS-User mailing list QGIS-User@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
[Qgis-user] CSV layer, Time column null expressie to test for NULL/empty?
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 if it has data: 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___ QGIS-User mailing list QGIS-User@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user