Yes, Ana is right. The StatisticsOp is probably the right tool for you. In this thread you can get some guidance: