I have many columns, about 30 and each of those has some attributes. I want to merge those columns to one and collect all attributes in a row of columns. I tried with this post but it is not for I am looking for. Combining Columns QGIS Attribute Table I have an example in ms excel what I want that without commas and spaces. Attributes have to be separated with one comma.
With this script, if some fields are empty, I have got null fields. Sorry for my English
Answer
array_filter( map_avals( attributes( )), @element <>'')
does the trick.
1/ attributes()
get all fields with their corresponding values
2/ map_avals()
: gives you just the values as an array
3/ array_filter(array, expression)
: the expression @element <>''
filters out the empty values
No comments:
Post a Comment