Repeat Unique Values in List by Different Amounts

Hi,

Referring to the image above, I want to place a letter for every set number, So 1 = a. 2=b etc. I know that is a terrible explanation I couldn’t think of a better one. So here is the output I want:

a
a
a
a
b
b
b
c
c
c
d
d
d

I’ve simplified the problem here and I am working with long strings instead of numbers.

Thanks for help

Hi @Joe.ashton

Use List.GroupByKey node to group the lists by its value -> List.Count -> And finally to use List.OffRepeated items with your other list and amount of List.Count.

1 Like

Wont uses List.Offrepeated items repeat all the items by the same amount? I want it set up in a way where the count can be different e.g there are 4 ones in this case but 3 of all the others.

But I gave it ago and this is what I made of it, I havent really got to grips with keys and such yet.

Edit: As this is not a one off and will be used with different amounts of data each time; I need it set-up in a way that the count of each unique value repeats the list by that amount. I’m not too sure how to set that up in a way that doesn’t matter how many values their on.

Change lacing to longest for “List.Count” node.

@Joe.ashton

2 Likes

1 Like

Got it working!

Thanks for the help