Skip to main content
Question

list flattening

  • March 25, 2018
  • 6 replies
  • 176 views

Forum|alt.badge.img

Hi All,

Just wondering what is the best option to flatten a list on each row to attributes? I know the lists are set at the same size index wise but wondering on the best method

thanks

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.

6 replies

takashi
Celebrity
  • March 25, 2018
Depends on what "to flatten list" means. For example, if the feature has a list called "_list{}" containing these elements, what would be your desired result?

 

_list{0} = 'a'
_list{1} = 'b'
_list{2} = 'c'

 


Forum|alt.badge.img
  • Author
  • March 25, 2018

Hi Takashi,

I would be happy with new attributes against the same parent row i.e. list0 = a, list1 = b and list2 = c.

I was looking at the exposer but thought there must be a simpler approach?


itay
Supporter
Forum|alt.badge.img+18
  • Supporter
  • March 25, 2018

Have a look at the listexploder


danilo_fme
Celebrity
Forum|alt.badge.img+52
  • Celebrity
  • March 25, 2018

Have a look at the listexploder

I agree wit you

 

 


Forum|alt.badge.img
  • Author
  • March 25, 2018
I agree wit you

 

 

Hi,

 

 

Does this not just create 3 rows - i need them all on the original row?

 

 

Thanks

takashi
Celebrity
  • March 25, 2018

Hi @lemzip, I think the BulkAttributeRenamer (Regular Expression Replace, Rename mode) can be used effectively here. If you exposed the list elements in the preceding transformer (Right-click on the list name - Expose Elements), the renamed attributes would be exposed automatically.

Text To Find: ^(_list){(\d+)}$  <regular expression that match every element of the list>
String: \1\2  <concatenate the parts matched sub expressions>

0684Q00000ArK83QAF.png