To find and replace all null values in a specific column I am using:
case when "myColumn" is NULL then '99999999' else "myColumn" end
But how can I use the QGIS calculator to find and replace all null values in the multiple columns?
-
Do I understand correct: You want to execute the query (which you say is working as expected) for all columns of a layer?Matthias Kuhn– Matthias Kuhn2013年09月11日 09:12:23 +00:00Commented Sep 11, 2013 at 9:12
-
I'm going to be a big old meanie here, and ask: are you sure you would ever want to do that? Using VERY_LARGE_NUM for unknown or invalid values is an old Fortran thing, and is used only by languages/systems which don't handle nulls properly. Could there ever be a time when you already legitimately had the value 99999999 in a column? Also, it's important that Null≠Null, but 99999999=わ=わ99999999, so testing for unknowns will no longer work. If this is for output, dump to CSV and sed null to 99999999. Srsly; drop the P-38, can of worms ahead...scruss– scruss2013年09月11日 13:14:50 +00:00Commented Sep 11, 2013 at 13:14
-
matthias Kuhn - yes thats is correctBwyss– Bwyss2013年09月12日 07:25:18 +00:00Commented Sep 12, 2013 at 7:25
2 Answers 2
That is currently not possible automatically in Field Calculator because these calculations can only affect one column.
Solutions would require python scripting.
You could always open the dbf-file (assuming you are working with a shape-file) directly in e.g. Open Office Calc (Excel doesn't handle dbf without problems...), select the columns of interest, and then run a simple find/replace within the selected columns.