Here's one way to do it using the summarize command. Summarize yields the list of unique values but they're a list of character strings.
dt = open("$sample_data\bands data.jmp");
summarize(humidity_list = by(:Humidity));
n = nitems(humidity_list);
humidity_mtx = index(1, n);
for (i = 1, i <= n, i++,
humidity_mtx[i] = num(humidity_list[i]);
humidity_mtx = sort descending(humidity_mtx);
[105, 103, 100, 98, 96, 95, 94, 93, 92, 91]
Thank you !
I have my ten values in this list but i would like now to select in a table, the lines which have a value in this list :
I tried : mytable<< Select Where(value in values_mtx);
but it doesnt work
The original question may be answered in different ways depending of the objectives.
PMroz code successfully selects all rows of the 10 top levels (which means more than ten rows selected if several rows have the same value).
If you rather want to select exactly ten rows with the highest values (and possibly leaving tied values of the lowest top-ten levels behind) this approach could be used:
dt = open("$sample_data\Bands Data.jmp");
dt << select rows(loc(ranking(:humidity[1::n])>=n-10));
Here's an alternative that selects the percentage of rows (roughly) corresponding to the to the top ten rows, but here tied rows with the lowest value of the top 10 rows are included:
dt << select where(:humidity >= col quantile(:humidity, 1-10/n));
All three approaches here yields different results, but each may be right depending on the circumstances.