CASE WHEN "vertex_index" = 0 THEN "start" ELSE "end" END --This expression is saying: --When the vertex_index attribute is 0 it must be the first point of the line in the direction of digitising so give it the "start" value into the new "chainage" column. Otherwise we assume it to be an "end" value in which case put the "end" value into the "chainage" column