I\'m making an aggregate report of stores, categories and customers for an ecommerce. Basically, I\'m trying to achieve what this function does: