Hi @Feli,
I think the function "Col Median()" might be useful in your case, as the scripting index mentions that "the ordering is cached internally so that multiple evaluations will be efficient". You can also specify a "By" group variable.
Example on the Big class dataset from the scripting index (menu Help, Scripting Index), with a formula for median height calculated for each Age group:
dt << New Column( "Col Median Height by Age",
numeric,
continuous,
formula( Col Median( :height, :age ) )
);
I hope this answer will help you,
Victor GUILLER
"It is not unusual for a well-designed experiment to analyze itself" (Box, Hunter and Hunter)