Skip to main content
Solved

Converting columns to string

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

penicillin wrote:

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

View original
Did this help you find an answer to your question?

4 replies

redgeographics
Celebrity
Forum|alt.badge.img+49

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
  • February 13, 2023
redgeographics wrote:

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+49
  • Celebrity
  • Best Answer
  • February 13, 2023
penicillin wrote:

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
  • February 13, 2023
penicillin wrote:

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!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings