Skip to main content
Solved

Split attributevalue into 2 different attributes

  • September 20, 2017
  • 7 replies
  • 1203 views

Forum|alt.badge.img

I have an attribute [complete] withe the value 1-A.

 

I would like to split that value to attribute [split1] with the value 1

 

and attribute [split2] with the value A

I've tried AttributeSplitter;AttributeTrimmer;AttributeCreator

Best answer by courtney_m

Use an AttributeSplitter with "Attribute to Split" set to complete, and Delimeter set to a dash (-). Then use a ListExploder to on the list attribute created by the splitter. You can then use a FeatureMerger to merge the records back together.

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.

7 replies

courtney_m
Contributor
Forum|alt.badge.img+19
  • Contributor
  • 127 replies
  • Best Answer
  • September 20, 2017

Use an AttributeSplitter with "Attribute to Split" set to complete, and Delimeter set to a dash (-). Then use a ListExploder to on the list attribute created by the splitter. You can then use a FeatureMerger to merge the records back together.


erik_jan
Contributor
Forum|alt.badge.img+22
  • Contributor
  • 2179 replies
  • September 20, 2017

Use an AttributeSplitter with "Attribute to Split" set to complete, and Delimeter set to a dash (-). Then use a ListExploder to on the list attribute created by the splitter. You can then use a FeatureMerger to merge the records back together.

Or follow the AttributeSplitter by an AttributeCreator to create [split1] with value _list{0} and [split2] with value _list{1}.

 

 


fmelizard
Safer
Forum|alt.badge.img+20
  • Safer
  • 3719 replies
  • September 20, 2017

Hi @kees_v, you can accomplish this using the AttributeManager as well. If you're splitting by only one character on each side of the -, you can set the transformer parameters as they are below:


courtney_m
Contributor
Forum|alt.badge.img+19
  • Contributor
  • 127 replies
  • September 20, 2017
Or follow the AttributeSplitter by an AttributeCreator to create [split1] with value _list{0} and [split2] with value _list{1}.

 

 

Yeah, that will work better!

Forum|alt.badge.img
  • Author
  • 18 replies
  • September 20, 2017

Use an AttributeSplitter with "Attribute to Split" set to complete, and Delimeter set to a dash (-). Then use a ListExploder to on the list attribute created by the splitter. You can then use a FeatureMerger to merge the records back together.

Thank you, exactly what i needed.

 

 


takashi
Celebrity
  • 7843 replies
  • September 21, 2017

Use an AttributeSplitter with "Attribute to Split" set to complete, and Delimeter set to a dash (-). Then use a ListExploder to on the list attribute created by the splitter. You can then use a FeatureMerger to merge the records back together.

Alternatively, you can also use the AttributeRenamer to rename "_list{0}" to "split1", "_list{1}" to "split2", after splitting the source string with the AttributeSplitter.

 

Anyway, I think the AttributeSplitter would be a general way to split a string by a specific separator character or string.

 

 


ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3434 replies
  • September 21, 2017

Hi @kees_v, you can accomplish this using the AttributeManager as well. If you're splitting by only one character on each side of the -, you can set the transformer parameters as they are below:

You can also use the location of the - to determine the input for the substring which will work irrespective of the number of characters either side of the - (as long as there is only a single -)

 

e.g.