Unfortunately, it’s not just 1 that the input list has. It might also have other numbers, and the resulting list must add those numbers in the specific index and the series should continue from the next indices. I hadn’t shown that in my first snip. Here is what happened when I followed your method…:
Index 4 should be continuing from 7, then 8, 9, 10 and so on until and unless there’s another number to add to it.
Maybe i’m following a convoluted way to acheive this…!?
I am trying to understand what you are trying to achieve but i am having a really hard time.
Could you further elaborate (maybe with the correct output and how you would get that) how you see the correct solution? (PS: English is not my first language)
Do you want [0,0,1,1,3,3,3,3,3]; ? Because i don’t understand how you would count your list
Try this
List.UniqueItems followed by IndexOf, add 1, split/slice your list there
Do with the second list what needs to be done
List.Create to put them back together and Flatten
So, like I explained in the previous replies, I need to reserve that much amount of number for the rooms. The problem is that after adding, there might be duplicate numbers. I thought this might be solved by using some kind of list condition, since the list structure that I’m having currently is sorted according to the location and levels of the rooms.
Sorry that i could not explain my needs correctly. The script that you’ve given there, is not my goal. Adding the things in code block into the flattened node at the end and continue the numbers from there is. I’ve added snip below to explain this, with my required goal at the end:
Adding item to front and Reserving Number code block(Remove item from last) is just added so that, the reserving number is added to the next room in series.
I think number 3 in the index 4, block is changed to 1 in the first watch node? but it should’nt, the numbers must be passed, and added, and the next value in the list should continue from that number…
Cant you use this logic? List logic, increment from previous value - #2 by AmolShah
What is the difference between what you want and cumulative counting and then adding those values?
What is the logic to go from your current list to your required list because i dont understand the pattern.