I have this combined dataset with building heights divided up over several columns ''Height'' ''Building_h'' and ''Building_L. My end goal is to combine them all in one new column. There are however, several problems:
All columns are strings. I am aware of the
to_real()
function, but it doesn't work as some of the values have 'm' behind it to indicate that they are in meters. How can I change them?I already used
regexp_replace( "height" , 'm.*', ' ')
in the field calculator to get rid of the 'm' behind meters and got those into a new field called 'without M', but now only the cases that had m are in this field. They are also still in the field they were originally in, so I still cannot apply theto_real()
.I want to use with ''WithoutM'' field to add all the other values to as well.
How do I do this?
Then there is ''Building_l'' which has the number of levels per building. And so, this is a different way of expressing building height than ''height'' and ''building_h'' do. If I say, for example that an average building level is 3 meters; is there a way I can multiply the value for ''building_l'' by 3 and also put this into the ''withoutM'' field?
Last problem is related to the fact that several buildings have a value in more than one column. For example in ''height'' and ''building_l'', how should I handle this?