Solved

Converting columns to string

  • 13 February 2023
  • 4 replies
  • 19 views

Hello,

 

I have a table with some attributes and I created a new column which is called "Description" with the following string, by using the text editor in attribute manager :

"New values, Dat: @Value(Dat), Nat: @Value(Nat), OBJNAM: @Value(OBJNAM)"

 

However in some cases there are no values in all those attributes and the output looks like this:

 

"New values, Dat: , Nat: Underground heigh., OBJNAM: , "

 

I would like to exclude the attributes that don't have a value (in my example the Dat and ONJNAM), for each row.

I guess I should use somewhere a conditional formatting but I am not sure how and where to do that.

 

 

icon

Best answer by redgeographics 13 February 2023, 14:07

View original

4 replies

Userlevel 5
Badge +25

Yes, this can be solved with conditional values but it's a bit of a hassle since there's three attributes which can all be missing or not, so 6 options in total to work out.

 

Alternatively, you could use a StringReplacer with a regular expression, removing "Dat:," "Nat:," and "OBJNAM: ,"

Yes, this can be solved with conditional values but it's a bit of a hassle since there's three attributes which can all be missing or not, so 6 options in total to work out.

 

Alternatively, you could use a StringReplacer with a regular expression, removing "Dat:," "Nat:," and "OBJNAM: ,"

They are more than 3 attributes! I just use an example here.

Also not all the rows are missing the same attributes. I will try the string replacer.

Userlevel 5
Badge +25

They are more than 3 attributes! I just use an example here.

Also not all the rows are missing the same attributes. I will try the string replacer.

(Dat: ,|Nat: ,|OBJNAM: $)

Should do the trick as Regex (using your example). And just replace with an empty string

They are more than 3 attributes! I just use an example here.

Also not all the rows are missing the same attributes. I will try the string replacer.

Yes, it works! Thank you!

Reply