I’m working on transactional math. A consumer gets loyalty points from many merchants, a consumer can spend these points at many merchants. The consumer can choose 5% of their purchase at the merchant as loyalty points to spend anywhere, or 10% of the purchase to come back and spend at the same place. A point represents a dollar of buying power. I need to display the total points available for a consumer to spend at a particular merchant, and separately, the amount of points to spend anywhere.
I currently have the transactions related between the consumer and merchant, this allows me to show a history of transactions for each party. I have a math column that adds up all the transactions for each consumer to show their total wallet, but I get stuck when I want to do this addition and split by merchant which would allow me to show total points a consumer can spend back at a particular merchant.