Lists to Number

Hello,

I want to assign a unique number to each list in the output from List.GroupByKey. Each group should be numbered sequentially (1, 2, 3, 4, etc.), and this number will be used in a text parameter. Elements with the same properties should receive the same number. Additionally, elements that do not belong to any group (i.e., have no similar elements) should each be assigned their own unique number as well.

Like this?

1 Like

Almost correct, but I want all elements within the same list to share the same number. For example, the first list (List 0) should have all its elements assigned the number 1. The second list (List 1) should have all its elements assigned the number 2, and so on. Each group of elements from the List.GroupByKey output should receive the same number, based on their list index in the grouped result.

here you go

1 Like

For some reason It didn’t work, but I added a level to amount In the List.Cycle and then It worked. Thank you once again.

1 Like