Try this with your source data table opened.
Names Default to Here(1);
dt = current data table();
dt << clear select();
dtsum = dt << Summary(Group(:date), N);
//by default the sumary table is linked to the source table
dtsum << select where(:N < 6);
close(dtsum,Nosave); //no longer needed, and the rows are selected in the source
dt << exclude(1);