Create a sublist when you find a certain value

Hi all,
I am wondering what is the easiest way to create sublists from a list of numbers when a certain value is present.
I mean…I have this list of numbers and I’d like to have its sublists every time 0 is found. How can I do?
image

Thanks in advance!

Here is one such way:

1 Like

Hi @jacob.small thank you for your reply.
Maybe I am not understanding you but what I want is to create sublists everytime it finds a certain value (in my case 0). 0 as value not as list value
According to the example in my screenshot I should have 2 sublist like shown:
image

1 Like

Yep - I used 1.0 as my divider but I believe that 0.0 works just as well.

Hi @robertoruggeri

How about this?

Hi @kulkul do you know why it gives me an empty list with the List.AllIndicedOf.
What am I wrong?
image

Try 2.0 - you’re comparing an integer to a double. :slight_smile:

@jacob.small thank you so much :slight_smile:

ehy @jacob.small even if it’s an offtopic, do you know why when I use List.RemoveItemAtIndex then I cannot use the results with List.Flatten (and also I cannot see them on Watch)
image

You don’t have two levels to flatten - try using a -1 or 1.

1 Like

Thank you @jacob.small, now it works.
While we’re talking about list, now I have 2 lists and I want to find the three values of List.UniqueItems 9,2,11 in List.Transpose, checking only the 0 index of that list in @L1. The result is the matching sublist with
2
5.5
0
0.
Is it possible to do it without coding? If no, what do you suggest?