Use Col Median to calculate median over groups. Then combine that with if-statement which checks for first row of the group using Col Min
Example:
Names Default To Here(1);
dt = New Table("Untitled",
Add Rows(8),
New Column("Group", Character, "Nominal", Set Values({"A", "A", "A", "A", "B", "B", "B", "B"})),
New Column("Param", Numeric, "Continuous", Format("Best", 12), Set Values([5, ., ., 6, 3, ., 2, .])),
New Column("Column 4", Numeric, "Continuous", Format("Best", 12), Set Values([., ., ., ., ., ., ., .]))
);
dt << New Column("Med", Numeric, Continuous, Formula(
If(Row() == Col Min(Row(), :Group),
Col Median(:Param, :Group)
,
.
)
));
-Jarmo