dt = Open( "$SAMPLE_DATA/Big Class Families.jmp" );
for(i=1, i<16, i++, dt<< Concatenate(dt,append to first table()));
wait(0);
show(nrows(dt));
Print("std rank");
t0 = hptime();
New Column( "std Rank",
Formula(
Col Rank( :height)
)
);
dt << run formulas();
show((hptime()-t0)/1000000);
Print("row_min rank median");
t0 = hptime();
New Column( "dense_Rank_ref1",
Formula(
Col Median(
Col Rank( If( Row() == Col Minimum( Row(), :height ), :height, . ) ),
:height
)
)
);
dt << run formulas();
show((hptime()-t0)/1000000);
print("summarize_contains");
t0 = hptime();
New Column( "dense rank_summarize_contains",
Formula(
As Constant( Summarize( theLevels = by( :height ) ) );
Contains( theLevels, Char( :height ) );
)
);
dt << run formulas();
show((hptime()-t0)/1000000);
print("row_min cumulative sum");
t0 = hptime();
print("- just works after sorting");
dt << Sort( By( :height ), Replace Table);
New Column( "dense_Rank_ref1",
Formula(
Col Cumulative Sum(If(Row() == Col Min(Row(), :height), 1,0))
)
);
dt << run formulas();
show((hptime()-t0)/1000000);
close(dt, nosave);