Forum

Tricky sorting question

Could be, that | am to dumb, but I don|t seem to be able to solve this problem. Maybe someone could help…

as input I have 2 spreads: ‘input list’ (strings) and ‘input time’ (values).

output are the same 2 spreads but without any double entries in the ‘input list’. the ‘input time’ spread is filtered exactly the same way as the ‘input list’ spread.

the problem is: I need the highest value of the ‘input time’ list to stay in this list.

Attached is the patch…

NoDoubles.v4p (12.8 kB)

is the highest value always the last you recieve? do you know every entry of the ‘input list’? if so, the node KeySort (Spreads) i coded for the (unfortunately cancelled) WM opening can help you.

i´d concatenate a string representation of the time to the string in question.

then sort these strings alphabetically.
discard the output of the sort, but use the outcoming indices to GetSlice the elements of the original spreads.

then test if the slices are equal to thir respective next slice (compare the spread with a +1 shifted version)

use that equality spread to Select the slices which are not equal to their predecessor (these are the unique slices)

thanx! i will try both tipps tomorrow. but sounds plausible…

got it!
KeySort would be much better, but it seems to be restricted to Values.
But Oschatz’s method worked. Thanx!