On Sat, 26 Dec 2020, Sven Schreiber wrote:
Am 26.12.2020 um 20:13 schrieb Allin Cottrell:
> On Sat, 26 Dec 2020, Sven Schreiber wrote:
>>
>> Right, sorry, I thought I was missing something. In the GUI this is
>> actually trivial in the sense that you can even sort a time series there
>> in the "show values" window. But in the CLI of course one doesn't
want
>> to apply "dataset sortby" to a time series!
>
> No, but what about this? (Sorry if I'm missing the point or repeating
> what has been said already.)
>
> <hansl>
> open AWM
> # show biggest 5 values
> eval dsort({GCR_YER})[1:5]
> </hansl>
I think the observation numbers or markers were also wanted. Perhaps
like this:
<hansl>
open AWM
# show biggest 5 values
series date = $obsdate
list L = GCR_YER date
eval mreverse(msortby({L}, 1)[1:5,])
</hansl>
But the number format of the date is not adequate there.
So:
<hansl>
open AWM
m = mreverse(msortby({obs, GCR_YER},2))[1:5,]
strings S = array(5)
loop i=1..5
S[i] = obslabel(m[i,1])
endloop
rnameset(m, S)
print m
</hansl>
But by now it's not quite so trivial.
Allin