Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
bcr123psu
Contributor II
Contributor II

Associations at different levels of granularity

Hello!  I'm running into an issue that I'm sure is pretty common but I haven't been able to resolve on my own yet.  We have a very basic app that needs to be built that shows sales rep performance vs. quota for specific targeted accounts.  The files consist of the Quota (Rep, Month, Type, Quota), Sales (Customer, Month, Type, Amount), and Customer (Customer, Customer Contact, State, Rep).  At the end of the day, we need to roll up the sales by type and compare it to the quota by type for each rep.  Mockups of each table are attached and examples are below.

The issue that I see is that quota is not set at the customer level, the customer data doesn't contain a month or type field, and the sales data doesn't contain the rep.  So I'm left with a circular association (below) that still doesn't return what I'm looking for.  Any feedback on how to approach this is greatly appreciated.  Thanks!

Associations.PNG

 

  

 

Quota:

RepMonthTypeQuota
JimJulyCommercial100000
JimAugustCommercial110000
JimSeptemberCommercial120000
JimJulyResidential50000
JimAugustResidential60000
JimSeptemberResidential70000
JimJulyIndustrial55000
JimAugustIndustrial55000
JimSeptemberIndustrial55000

 

Sales:

CustomerSale MonthTypeAmount
185188JulyCommercial10900
107227JulyCommercial20888
157811JulyCommercial2282
148966JulyResidential4913
118633JulyIndustrial16446
197725JulyIndustrial2398
114268JulyIndustrial7265
133108JulyIndustrial23461
191580JulyResidential11848
173991JulyCommercial20506

 

Customer:

CustomerCustomer ContactStateRep
185188Isis HellmanMEKawal
107227Alesia MainsLAKawal
157811Lindsy LewNVDenise
148966Racquel GregorNMJim
118633Harriet NeatheryVADenise
197725Rosita RansomeNHKawal
114268Deedra CandlerKSKawal
133108Linwood CourseyHIJim
191580Hsiu MentoNMKawal
173991Gaynell HenkelDEJim
Labels (3)
0 Replies