Skip to main content

I want to find a way to pull out the first 13 characters in each list element until the list ends (identified by ItemsInList attribute). I currently have this:

@Left(@Value(_list_UAIDs{@Value(ItemsInList)}),13)

However this only returns the last entry. I want it to return every instance within the list.

I wasn't sure if it was that simple of if I could create a looper to resolve this?

Would it be possible for your data to explode the list with the ListExploder, use the function you have posted and then build the list again?


If not wanting to explode the list, I'd probably use python to do this.


Exploding for this purpose has done the trick, but I still would find it interesting if it's possible to extract this data in a single cell, maybe separated by a comma?


Exploding for this purpose has done the trick, but I still would find it interesting if it's possible to extract this data in a single cell, maybe separated by a comma?

If you wanted to use a pythoncaller, this would create a new comma separated value in an attribute called first_13 where _list{}.value is the name of your list

import fme
import fmeobjects

def firstthirteen(feature):

    mylist = >value>:13] for value in feature.getAttribute('_list{}.value')]  
    feature.setAttribute("first_13",','.join(mylist))

 


Reply