QGIS: Delete all records/rows with NULL values
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
3
down vote
favorite
I have joined a CSV file to a shapefile by a common key in QGIS. Not all records in the shapefile and CSV had corresponding keys.
This left some records in the shapefile as NULL.
i.e.
City School_ID ID_no Total
London 1234 1234 12
Glasgow 4321 4321 10
Bristol 4444 NULL NULL
This is just a small slice of the data. The actual data has about 12000 records.
Is there any way to delete all records/rows with NULL values?
qgis null
add a comment |Â
up vote
3
down vote
favorite
I have joined a CSV file to a shapefile by a common key in QGIS. Not all records in the shapefile and CSV had corresponding keys.
This left some records in the shapefile as NULL.
i.e.
City School_ID ID_no Total
London 1234 1234 12
Glasgow 4321 4321 10
Bristol 4444 NULL NULL
This is just a small slice of the data. The actual data has about 12000 records.
Is there any way to delete all records/rows with NULL values?
qgis null
1
Can't you just sort the data, so all NULL values are on top or bottom of the attribute table, then manually highlight the rows and delete them? Even with 12000 records it should be easily done.
– gHupf
Aug 17 at 13:36
Hi @gHupf, my sentiments exactly. However, there only seems to be an option to delete fields, as opposed to delete rows.
– kris_Co2
Aug 17 at 13:41
Hi @BERA, thank you for your reply. I know ArcGis allows you to keep only matching records, but in QGIS when joining vectors - there does not appear to be an option to select "join only matcihng records".
– kris_Co2
Aug 17 at 13:48
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I have joined a CSV file to a shapefile by a common key in QGIS. Not all records in the shapefile and CSV had corresponding keys.
This left some records in the shapefile as NULL.
i.e.
City School_ID ID_no Total
London 1234 1234 12
Glasgow 4321 4321 10
Bristol 4444 NULL NULL
This is just a small slice of the data. The actual data has about 12000 records.
Is there any way to delete all records/rows with NULL values?
qgis null
I have joined a CSV file to a shapefile by a common key in QGIS. Not all records in the shapefile and CSV had corresponding keys.
This left some records in the shapefile as NULL.
i.e.
City School_ID ID_no Total
London 1234 1234 12
Glasgow 4321 4321 10
Bristol 4444 NULL NULL
This is just a small slice of the data. The actual data has about 12000 records.
Is there any way to delete all records/rows with NULL values?
qgis null
edited Aug 17 at 16:28


nmtoken
7,55642762
7,55642762
asked Aug 17 at 13:27
kris_Co2
1085
1085
1
Can't you just sort the data, so all NULL values are on top or bottom of the attribute table, then manually highlight the rows and delete them? Even with 12000 records it should be easily done.
– gHupf
Aug 17 at 13:36
Hi @gHupf, my sentiments exactly. However, there only seems to be an option to delete fields, as opposed to delete rows.
– kris_Co2
Aug 17 at 13:41
Hi @BERA, thank you for your reply. I know ArcGis allows you to keep only matching records, but in QGIS when joining vectors - there does not appear to be an option to select "join only matcihng records".
– kris_Co2
Aug 17 at 13:48
add a comment |Â
1
Can't you just sort the data, so all NULL values are on top or bottom of the attribute table, then manually highlight the rows and delete them? Even with 12000 records it should be easily done.
– gHupf
Aug 17 at 13:36
Hi @gHupf, my sentiments exactly. However, there only seems to be an option to delete fields, as opposed to delete rows.
– kris_Co2
Aug 17 at 13:41
Hi @BERA, thank you for your reply. I know ArcGis allows you to keep only matching records, but in QGIS when joining vectors - there does not appear to be an option to select "join only matcihng records".
– kris_Co2
Aug 17 at 13:48
1
1
Can't you just sort the data, so all NULL values are on top or bottom of the attribute table, then manually highlight the rows and delete them? Even with 12000 records it should be easily done.
– gHupf
Aug 17 at 13:36
Can't you just sort the data, so all NULL values are on top or bottom of the attribute table, then manually highlight the rows and delete them? Even with 12000 records it should be easily done.
– gHupf
Aug 17 at 13:36
Hi @gHupf, my sentiments exactly. However, there only seems to be an option to delete fields, as opposed to delete rows.
– kris_Co2
Aug 17 at 13:41
Hi @gHupf, my sentiments exactly. However, there only seems to be an option to delete fields, as opposed to delete rows.
– kris_Co2
Aug 17 at 13:41
Hi @BERA, thank you for your reply. I know ArcGis allows you to keep only matching records, but in QGIS when joining vectors - there does not appear to be an option to select "join only matcihng records".
– kris_Co2
Aug 17 at 13:48
Hi @BERA, thank you for your reply. I know ArcGis allows you to keep only matching records, but in QGIS when joining vectors - there does not appear to be an option to select "join only matcihng records".
– kris_Co2
Aug 17 at 13:48
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
9
down vote
accepted
In the attribute table, choose Select by Expression and write "FIELD_NAME" IS null
(replace FIELD_NAME with your actual field names, of course). Click "Select Features", then simply delete the resulting selected features.
Hi Nathan, Thank you for replying. There does not seem to be a delete button for records in the attributes view. The only delete button seems to correspond to fields or columns. THis is where I am having the issue.
– kris_Co2
Aug 17 at 13:46
3
Allow editing for the layer (maybe you have to save it as a shapefile first), then there's this nice red trash bin you can use to dispose of your unwanted features. You cannot delete single table fields, only rows or columns.
– Erik
Aug 17 at 13:47
If you click on the number on the left of the attribute table, the whole row gets highlighted and you can just delete it.
– gHupf
Aug 17 at 13:48
You can also choose Edit->Cut features (or use the scissors icon that's right next to the trash bin) if you want to keep the features in your clipboard.
– Nathan
Aug 17 at 13:53
@Erik - thank you so much ! I did not have the editing setting on!
– kris_Co2
Aug 17 at 14:00
 |Â
show 4 more comments
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
9
down vote
accepted
In the attribute table, choose Select by Expression and write "FIELD_NAME" IS null
(replace FIELD_NAME with your actual field names, of course). Click "Select Features", then simply delete the resulting selected features.
Hi Nathan, Thank you for replying. There does not seem to be a delete button for records in the attributes view. The only delete button seems to correspond to fields or columns. THis is where I am having the issue.
– kris_Co2
Aug 17 at 13:46
3
Allow editing for the layer (maybe you have to save it as a shapefile first), then there's this nice red trash bin you can use to dispose of your unwanted features. You cannot delete single table fields, only rows or columns.
– Erik
Aug 17 at 13:47
If you click on the number on the left of the attribute table, the whole row gets highlighted and you can just delete it.
– gHupf
Aug 17 at 13:48
You can also choose Edit->Cut features (or use the scissors icon that's right next to the trash bin) if you want to keep the features in your clipboard.
– Nathan
Aug 17 at 13:53
@Erik - thank you so much ! I did not have the editing setting on!
– kris_Co2
Aug 17 at 14:00
 |Â
show 4 more comments
up vote
9
down vote
accepted
In the attribute table, choose Select by Expression and write "FIELD_NAME" IS null
(replace FIELD_NAME with your actual field names, of course). Click "Select Features", then simply delete the resulting selected features.
Hi Nathan, Thank you for replying. There does not seem to be a delete button for records in the attributes view. The only delete button seems to correspond to fields or columns. THis is where I am having the issue.
– kris_Co2
Aug 17 at 13:46
3
Allow editing for the layer (maybe you have to save it as a shapefile first), then there's this nice red trash bin you can use to dispose of your unwanted features. You cannot delete single table fields, only rows or columns.
– Erik
Aug 17 at 13:47
If you click on the number on the left of the attribute table, the whole row gets highlighted and you can just delete it.
– gHupf
Aug 17 at 13:48
You can also choose Edit->Cut features (or use the scissors icon that's right next to the trash bin) if you want to keep the features in your clipboard.
– Nathan
Aug 17 at 13:53
@Erik - thank you so much ! I did not have the editing setting on!
– kris_Co2
Aug 17 at 14:00
 |Â
show 4 more comments
up vote
9
down vote
accepted
up vote
9
down vote
accepted
In the attribute table, choose Select by Expression and write "FIELD_NAME" IS null
(replace FIELD_NAME with your actual field names, of course). Click "Select Features", then simply delete the resulting selected features.
In the attribute table, choose Select by Expression and write "FIELD_NAME" IS null
(replace FIELD_NAME with your actual field names, of course). Click "Select Features", then simply delete the resulting selected features.
answered Aug 17 at 13:41


Nathan
52029
52029
Hi Nathan, Thank you for replying. There does not seem to be a delete button for records in the attributes view. The only delete button seems to correspond to fields or columns. THis is where I am having the issue.
– kris_Co2
Aug 17 at 13:46
3
Allow editing for the layer (maybe you have to save it as a shapefile first), then there's this nice red trash bin you can use to dispose of your unwanted features. You cannot delete single table fields, only rows or columns.
– Erik
Aug 17 at 13:47
If you click on the number on the left of the attribute table, the whole row gets highlighted and you can just delete it.
– gHupf
Aug 17 at 13:48
You can also choose Edit->Cut features (or use the scissors icon that's right next to the trash bin) if you want to keep the features in your clipboard.
– Nathan
Aug 17 at 13:53
@Erik - thank you so much ! I did not have the editing setting on!
– kris_Co2
Aug 17 at 14:00
 |Â
show 4 more comments
Hi Nathan, Thank you for replying. There does not seem to be a delete button for records in the attributes view. The only delete button seems to correspond to fields or columns. THis is where I am having the issue.
– kris_Co2
Aug 17 at 13:46
3
Allow editing for the layer (maybe you have to save it as a shapefile first), then there's this nice red trash bin you can use to dispose of your unwanted features. You cannot delete single table fields, only rows or columns.
– Erik
Aug 17 at 13:47
If you click on the number on the left of the attribute table, the whole row gets highlighted and you can just delete it.
– gHupf
Aug 17 at 13:48
You can also choose Edit->Cut features (or use the scissors icon that's right next to the trash bin) if you want to keep the features in your clipboard.
– Nathan
Aug 17 at 13:53
@Erik - thank you so much ! I did not have the editing setting on!
– kris_Co2
Aug 17 at 14:00
Hi Nathan, Thank you for replying. There does not seem to be a delete button for records in the attributes view. The only delete button seems to correspond to fields or columns. THis is where I am having the issue.
– kris_Co2
Aug 17 at 13:46
Hi Nathan, Thank you for replying. There does not seem to be a delete button for records in the attributes view. The only delete button seems to correspond to fields or columns. THis is where I am having the issue.
– kris_Co2
Aug 17 at 13:46
3
3
Allow editing for the layer (maybe you have to save it as a shapefile first), then there's this nice red trash bin you can use to dispose of your unwanted features. You cannot delete single table fields, only rows or columns.
– Erik
Aug 17 at 13:47
Allow editing for the layer (maybe you have to save it as a shapefile first), then there's this nice red trash bin you can use to dispose of your unwanted features. You cannot delete single table fields, only rows or columns.
– Erik
Aug 17 at 13:47
If you click on the number on the left of the attribute table, the whole row gets highlighted and you can just delete it.
– gHupf
Aug 17 at 13:48
If you click on the number on the left of the attribute table, the whole row gets highlighted and you can just delete it.
– gHupf
Aug 17 at 13:48
You can also choose Edit->Cut features (or use the scissors icon that's right next to the trash bin) if you want to keep the features in your clipboard.
– Nathan
Aug 17 at 13:53
You can also choose Edit->Cut features (or use the scissors icon that's right next to the trash bin) if you want to keep the features in your clipboard.
– Nathan
Aug 17 at 13:53
@Erik - thank you so much ! I did not have the editing setting on!
– kris_Co2
Aug 17 at 14:00
@Erik - thank you so much ! I did not have the editing setting on!
– kris_Co2
Aug 17 at 14:00
 |Â
show 4 more comments
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f293141%2fqgis-delete-all-records-rows-with-null-values%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
Can't you just sort the data, so all NULL values are on top or bottom of the attribute table, then manually highlight the rows and delete them? Even with 12000 records it should be easily done.
– gHupf
Aug 17 at 13:36
Hi @gHupf, my sentiments exactly. However, there only seems to be an option to delete fields, as opposed to delete rows.
– kris_Co2
Aug 17 at 13:41
Hi @BERA, thank you for your reply. I know ArcGis allows you to keep only matching records, but in QGIS when joining vectors - there does not appear to be an option to select "join only matcihng records".
– kris_Co2
Aug 17 at 13:48