A table A has 100 account having 600K in revenue. I want to create a column that spreads each account evenly across all unique medium and location. There are 4 location and 10 distinct mediums. How can I write a procedure to get this result.
For e.g. Suppose the Account 1 has overall revenue of 10,000. Now I have to combine Account 1 to Mediums and Location. As 1 account can have multiple medium and location it would cross multiply. I want that how many different combinations of location and medium I take I end up with same amount. There can be multiple accounts. Below is the image