Tag Selected: how to calculate data in array