Skip to main content
Question

list flattening


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

6 replies

takashi
Influencer
  • 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+17
  • Supporter
  • March 25, 2018

Have a look at the listexploder


danilo_fme
Evangelist
Forum|alt.badge.img+44
  • Evangelist
  • March 25, 2018
itay wrote:

Have a look at the listexploder

I agree wit you

 

 


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

 

 

Hi,

 

 

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

 

 

Thanks

takashi
Influencer
  • 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


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