finish aggregatiion on three tables in view level