How to Fill blank Fields with other column QGIS
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
I have two columns of the same data and I want to unite
for example I have the column "pole_type" and "pole_type_"
and sometimes one has values and some times the other
like seen in the photo
I want to get all the values in "pole_type_" into "pole_type" so I can delete the first
Iv'e used so far the following rules but not succeeded
IF(NULL,"pole_type_","pole_type")
or
IF("pole_type='',"pole_type_","pole_type")
and so on
but I havn't came up with anything that works.
qgis field-calculator
add a comment |Â
up vote
2
down vote
favorite
I have two columns of the same data and I want to unite
for example I have the column "pole_type" and "pole_type_"
and sometimes one has values and some times the other
like seen in the photo
I want to get all the values in "pole_type_" into "pole_type" so I can delete the first
Iv'e used so far the following rules but not succeeded
IF(NULL,"pole_type_","pole_type")
or
IF("pole_type='',"pole_type_","pole_type")
and so on
but I havn't came up with anything that works.
qgis field-calculator
1
Assuming empty are blank, not NULL (your second example), try adding a second = and remove the space :IF("pole_type"=="","pole_type_","pole_type")
â smiller
55 mins ago
Are you able to perform a selection of your data (outside of the calculator) for either blank or NULL? An example of selecting for NULL is here: gis.stackexchange.com/questions/16134
â smiller
52 mins ago
In the screenshots your column is called "/_pole_type" (with an underscore at the start) but your formulas use "pole_type_" (with an underscore at the end).
â csk
32 mins ago
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I have two columns of the same data and I want to unite
for example I have the column "pole_type" and "pole_type_"
and sometimes one has values and some times the other
like seen in the photo
I want to get all the values in "pole_type_" into "pole_type" so I can delete the first
Iv'e used so far the following rules but not succeeded
IF(NULL,"pole_type_","pole_type")
or
IF("pole_type='',"pole_type_","pole_type")
and so on
but I havn't came up with anything that works.
qgis field-calculator
I have two columns of the same data and I want to unite
for example I have the column "pole_type" and "pole_type_"
and sometimes one has values and some times the other
like seen in the photo
I want to get all the values in "pole_type_" into "pole_type" so I can delete the first
Iv'e used so far the following rules but not succeeded
IF(NULL,"pole_type_","pole_type")
or
IF("pole_type='',"pole_type_","pole_type")
and so on
but I havn't came up with anything that works.
qgis field-calculator
qgis field-calculator
asked 1 hour ago
tristramit
657
657
1
Assuming empty are blank, not NULL (your second example), try adding a second = and remove the space :IF("pole_type"=="","pole_type_","pole_type")
â smiller
55 mins ago
Are you able to perform a selection of your data (outside of the calculator) for either blank or NULL? An example of selecting for NULL is here: gis.stackexchange.com/questions/16134
â smiller
52 mins ago
In the screenshots your column is called "/_pole_type" (with an underscore at the start) but your formulas use "pole_type_" (with an underscore at the end).
â csk
32 mins ago
add a comment |Â
1
Assuming empty are blank, not NULL (your second example), try adding a second = and remove the space :IF("pole_type"=="","pole_type_","pole_type")
â smiller
55 mins ago
Are you able to perform a selection of your data (outside of the calculator) for either blank or NULL? An example of selecting for NULL is here: gis.stackexchange.com/questions/16134
â smiller
52 mins ago
In the screenshots your column is called "/_pole_type" (with an underscore at the start) but your formulas use "pole_type_" (with an underscore at the end).
â csk
32 mins ago
1
1
Assuming empty are blank, not NULL (your second example), try adding a second = and remove the space :
IF("pole_type"=="","pole_type_","pole_type")
â smiller
55 mins ago
Assuming empty are blank, not NULL (your second example), try adding a second = and remove the space :
IF("pole_type"=="","pole_type_","pole_type")
â smiller
55 mins ago
Are you able to perform a selection of your data (outside of the calculator) for either blank or NULL? An example of selecting for NULL is here: gis.stackexchange.com/questions/16134
â smiller
52 mins ago
Are you able to perform a selection of your data (outside of the calculator) for either blank or NULL? An example of selecting for NULL is here: gis.stackexchange.com/questions/16134
â smiller
52 mins ago
In the screenshots your column is called "/_pole_type" (with an underscore at the start) but your formulas use "pole_type_" (with an underscore at the end).
â csk
32 mins ago
In the screenshots your column is called "/_pole_type" (with an underscore at the start) but your formulas use "pole_type_" (with an underscore at the end).
â csk
32 mins ago
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
3
down vote
Welcome to the wonders of COALESCE
. Try this:
COALESCE( "pole_type_" , "pole_type" )
It will return the first non-null value in a list. If they are all null, it will return null.
add a comment |Â
up vote
0
down vote
You can use:
CASE
WHEN "pole_type" IS NULL THEN "pole_type_"
ELSE "pole_type"
END
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
Welcome to the wonders of COALESCE
. Try this:
COALESCE( "pole_type_" , "pole_type" )
It will return the first non-null value in a list. If they are all null, it will return null.
add a comment |Â
up vote
3
down vote
Welcome to the wonders of COALESCE
. Try this:
COALESCE( "pole_type_" , "pole_type" )
It will return the first non-null value in a list. If they are all null, it will return null.
add a comment |Â
up vote
3
down vote
up vote
3
down vote
Welcome to the wonders of COALESCE
. Try this:
COALESCE( "pole_type_" , "pole_type" )
It will return the first non-null value in a list. If they are all null, it will return null.
Welcome to the wonders of COALESCE
. Try this:
COALESCE( "pole_type_" , "pole_type" )
It will return the first non-null value in a list. If they are all null, it will return null.
answered 50 mins ago
Hayden Elza
1436
1436
add a comment |Â
add a comment |Â
up vote
0
down vote
You can use:
CASE
WHEN "pole_type" IS NULL THEN "pole_type_"
ELSE "pole_type"
END
add a comment |Â
up vote
0
down vote
You can use:
CASE
WHEN "pole_type" IS NULL THEN "pole_type_"
ELSE "pole_type"
END
add a comment |Â
up vote
0
down vote
up vote
0
down vote
You can use:
CASE
WHEN "pole_type" IS NULL THEN "pole_type_"
ELSE "pole_type"
END
You can use:
CASE
WHEN "pole_type" IS NULL THEN "pole_type_"
ELSE "pole_type"
END
answered 24 mins ago
Bhekani Khumalo
112
112
add a comment |Â
add a comment |Â
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%2f300048%2fhow-to-fill-blank-fields-with-other-column-qgis%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
Assuming empty are blank, not NULL (your second example), try adding a second = and remove the space :
IF("pole_type"=="","pole_type_","pole_type")
â smiller
55 mins ago
Are you able to perform a selection of your data (outside of the calculator) for either blank or NULL? An example of selecting for NULL is here: gis.stackexchange.com/questions/16134
â smiller
52 mins ago
In the screenshots your column is called "/_pole_type" (with an underscore at the start) but your formulas use "pole_type_" (with an underscore at the end).
â csk
32 mins ago