0

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?

underdark
84.9k22 gold badges237 silver badges419 bronze badges
asked Sep 11, 2013 at 8:30
3
  • Do I understand correct: You want to execute the query (which you say is working as expected) for all columns of a layer? Commented 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... Commented Sep 11, 2013 at 13:14
  • matthias Kuhn - yes thats is correct Commented Sep 12, 2013 at 7:25

2 Answers 2

1

That is currently not possible automatically in Field Calculator because these calculations can only affect one column.

Solutions would require python scripting.

answered Sep 11, 2013 at 9:16
1

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.

answered Sep 11, 2013 at 11:17

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.