Skip to main content
Solved

Converting columns to string

  • February 13, 2023
  • 4 replies
  • 276 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.

 

 

Best answer by redgeographics

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

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

4 replies

redgeographics
Celebrity
Forum|alt.badge.img+59
  • Celebrity
  • 3699 replies
  • February 13, 2023

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: ,"


  • Author
  • 5 replies
  • February 13, 2023

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.


redgeographics
Celebrity
Forum|alt.badge.img+59
  • Celebrity
  • 3699 replies
  • Best Answer
  • February 13, 2023

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


  • Author
  • 5 replies
  • February 13, 2023

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!