Dynamic Expand List
I have a Transactions LIST column with varying values.
I have a SampleSize INTEGER column with values based on a lookup sheet.
I am trying to pull out the number of list elements based on my SampleSize column.
I am doing this for static value with the following to extract the first two however, sometimes it is more, sometimes it is less.
LIST(LISTELEMENT(#Transactions;0);(LISTELEMENT(#Transactions;1)))))
How do I extract N list elements in this scenario?
Thank you!
-
Transactions(LIST) SampleSize(INT) Example Result(LIST) anise, basil, caraway, cilantro, chamomile, dill 2 anise, basil cilantro, chamomile, dill, fennel, lavender, lemon Grass 3 cilantro, chamomile, dill anise, basil, caraway, cilantro, chamomile, dill 1 anise anise, fennel, lavender, parsley, rosemary 2 anise, fennel -
Hello Matthew.
Thank you for the sample.I guess in this case you could use SUBLIST function - SUBLIST(<Initial LIST>;<Start from the element>;<Length>).
SUBLIST(#Transactions;0;#SampleSize) - which means Create a new list from Transactions > Start from Transactions first element > include SampleSize elements of the initial Transactions list.
Please sign in to leave a comment.
Comments
3 comments