Replace multiple recurring items with different values

Hi All,

I’m trying to replace a list of values with different values depending on if that value has already occurred or not. See below for example:

I have a list of words:

BUS
METRO
FERRY
FERRY
BUS
FERRY
LIGHT RAIL
LIGHT RAIL

Where the first instance of each word would have a value of 1, and then the following 0.5, 0.25 etc

So the list would read:

1
1
1
0.5
0.5
0.25
1
0.5

How would go about doing this?


Mathers.gh (16.7 KB)

1 Like

That is a much simpler solution than what I just came up with! Thanks Mahdiyar!