Aggregate series and Portfolio()

In an aggregate series, UnivMedian(“Portfolio(123456)”,“MktCap”) throws an error;
ERROR: In Rule 1: Error near ‘Portfolio’: Invalid command ‘Portfolio’

Is there a way to make Portfolio() work in an aggregate series?

Also, Is there any documentation on the Portfolio() function? The doc in reference appears to be for a different function.

I think supporting portfolio() in the aggregate series tool is a good idea. Can p123 comment?