The script for calculating rank of reports