Solved

Truncating a list


Badge +9

Is there a way to truncate a list?

 

For example if I have a list of 30 items but only want the first 10 to be kept. I know

I could manually create the list with an attribute creator using _list{0}, _list{1}, _list{2}, etc but just wanted to see if there is a transform or more automated way to do something like this.

 

Regards

 

Dean

icon

Best answer by geomancer 9 May 2022, 10:03

View original

4 replies

Userlevel 4
Badge +36

Have you looked at ListSlicer from FME Hub?

Badge +4

Hi @deanhowell​ , here is another transformer to try: ListSampler -> First N Elements

Badge +9

Have you looked at ListSlicer from FME Hub?

Thanks @geomancer​ the ListSlicer worked perfectly.

Badge +9

Hi @deanhowell​ , here is another transformer to try: ListSampler -> First N Elements

Thanks @connecter​ I will look into the ListSampler as that looks good also.

Reply