Main query

* Create query for calculate data act
* update procedure refresh