Function calculateSubscriptionGroup