Oh, many thanks Francis.. That is tricky. Ok, will try. To get my current flow working, I will use variable assignment in nginx and set variable a value with aggregate field. So, I can reuse it without calling aggregation several times. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,229882,229941#msg-229941