How to Fill blank Fields with other column QGIS

The name of the pictureThe name of the pictureThe name of the pictureClash 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



enter image description here



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.









share

















  • 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















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



enter image description here



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.









share

















  • 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













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



enter image description here



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.









share













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



enter image description here



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





share












share










share



share










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













  • 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











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.






share|improve this answer



























    up vote
    0
    down vote













    You can use:



    CASE
    WHEN "pole_type" IS NULL THEN "pole_type_"
    ELSE "pole_type"
    END






    share|improve this answer




















      Your Answer







      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "79"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      convertImagesToLinks: false,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













       

      draft saved


      draft discarded


















      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






























      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.






      share|improve this answer
























        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.






        share|improve this answer






















          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.






          share|improve this answer












          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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 50 mins ago









          Hayden Elza

          1436




          1436






















              up vote
              0
              down vote













              You can use:



              CASE
              WHEN "pole_type" IS NULL THEN "pole_type_"
              ELSE "pole_type"
              END






              share|improve this answer
























                up vote
                0
                down vote













                You can use:



                CASE
                WHEN "pole_type" IS NULL THEN "pole_type_"
                ELSE "pole_type"
                END






                share|improve this answer






















                  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






                  share|improve this answer












                  You can use:



                  CASE
                  WHEN "pole_type" IS NULL THEN "pole_type_"
                  ELSE "pole_type"
                  END







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 24 mins ago









                  Bhekani Khumalo

                  112




                  112



























                       

                      draft saved


                      draft discarded















































                       


                      draft saved


                      draft discarded














                      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













































































                      Comments

                      Popular posts from this blog

                      What does second last employer means? [closed]

                      Installing NextGIS Connect into QGIS 3?

                      One-line joke