cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
lala
Level VII

How does text format content get in memory without repetition?

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!

1 REPLY 1
jthi
Super User

Re: How does text format content get in memory without repetition?

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

-Jarmo