Like this first column:
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Add Rows( 1, after( N Row( dt ) ) );
dt[N Rows( dt ), 1] = dt[1, 1];
ar = dt << GetAsMatrix( 1 );nn = Matrix( Associative Array( ar[0, 1] ) << getKeys );//??
Thanks!
Use Summarize()
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << Add Rows(1, after(N Row(dt)));
dt[N Rows(dt), 1] = dt[1, 1];
Summarize(dt, uniq = By(Column(dt, 1)));
show(uniq);
or associative array()
Associative Array(Column(dt, 1)) << get keys
or create summary table and get values from there
dt_summary = dt << Summary(
Group(Column(dt, 1)),
Freq("None"),
Weight("None"),
Link to original data table(0),
private
);
a = dt_summary[0, 1];
Close(dt_summary, No save);
show(a);
All of these have their own use cases
Use Summarize()
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << Add Rows(1, after(N Row(dt)));
dt[N Rows(dt), 1] = dt[1, 1];
Summarize(dt, uniq = By(Column(dt, 1)));
show(uniq);
or associative array()
Associative Array(Column(dt, 1)) << get keys
or create summary table and get values from there
dt_summary = dt << Summary(
Group(Column(dt, 1)),
Freq("None"),
Weight("None"),
Link to original data table(0),
private
);
a = dt_summary[0, 1];
Close(dt_summary, No save);
show(a);
All of these have their own use cases
Thanks Experts!
Can a list already in memory be filtered by a similar function?
a1={"A","B","C","D","E","B","C","D","E"};
All of the same methods work, but for summary/summarize you have to first create a data table. For associative array it is more simple Scripting Guide > Data Structures > Associative Arrays in JSL Scripts > Create Associative Arrays
Names Default To Here(1);
a1 = {"A", "B", "C", "D", "E", "B", "C", "D", "E"};
a2 = Associative Array(a1) << get keys;