pass key and value of "by" to function

Hello,

I wrote

select money:{lub meg3[y]}'[op;time] from select time%1000 by op from t

Because I do not know how to push result of?time%1000 by op to my function.

Are there any way to rewrite it to more simple form without subquery?

Thank you,

–
Regards,
? Alexander.

willselect {lub meg3[y]}[first op;time%1000] by op from twork for you?