Forum Discussion
Expression.Error: There weren't enough elements in the enumeration to complete the operation.
See below. The basic gist of this is that each client has a LeadAdvisor, and they also can have a Sales1 person, a Sales2 person, and/or a Sales3 person. Sometimes a LeadAdvisor also shows up in a Sales spot. Each of those sales positions is assigned a percentage.
If a Value is in the Lead Advisor spot, then we want to sum 1*AUM and 1*Fees Paid (so the full amount of each).
If a Value is in any of the Sales1,2,3 spots, and is not also LeadAdvisor then we want AUM and Fees times the respective Sales%, and we don't want to double count clients.
But if a Value is in both LeadAdvisor and a Sales spot, they only get the 1*AUM and 1*Fees.
So if Kevin is both Lead and Sales2, he just gets 1*AUM and 1*Fees on that client, he does not also get Sales2%*AUM and Sales2*Fees. But if Kevin is only in a Sales spot for a client and not a Lead, then he only gets the %*Sales.
Thank you!
| QtrEndDate | Client | Attribute | AUM | Fees paid | Sales1% | Sales2% | Sales3% | Value |
| 12/31/2022 | 0261C7E9-2579 | LeadAdvisor | $ 8,006,181 | $ 57,679 | 1 | 0 | 0 | Eric |
| 12/31/2022 | 0261C7E9-2579 | Sales1 | $ 8,006,181 | $ 57,679 | 1 | 0 | 0 | Howard |
| 12/31/2022 | 12579E87-46DA | Sales1 | $ 3,497,261 | $ 17,148 | 0.5 | 0.5 | 0 | Craig |
| 12/31/2022 | 257F23A2-ED44 | LeadAdvisor | $ 96,806 | $ 902 | 1 | 0 | 0 | Jay |
| 12/31/2022 | 257F23A2-ED44 | Sales1 | $ 96,806 | $ 902 | 1 | 0 | 0 | Jay |
| 12/31/2022 | 257F9CA9-444D | LeadAdvisor | $ 32,601,966 | $ 113,302 | 0.85 | 0.12 | 0.03 | Tim |
| 12/31/2022 | 257F9CA9-444D | Sales2 | $ 32,601,966 | $ 113,302 | 0.85 | 0.12 | 0.03 | Tim |
| 12/31/2022 | 257F9CA9-444D | Sales3 | $ 32,601,966 | $ 113,302 | 0.85 | 0.12 | 0.03 | Chris |
| 12/31/2022 | 49EAAB00-257E | LeadAdvisor | $ - | $ - | 1 | 0 | 0 | Amanda |
| 12/31/2022 | 49EAAB00-257E | Sales1 | $ - | $ - | 1 | 0 | 0 | Amanda |
| 12/31/2022 | 52325704-1372 | LeadAdvisor | $ 467,760 | $ 7,328 | 0.75 | 0.25 | 0 | Amanda |
| 12/31/2022 | 52325704-1372 | Sales1 | $ 467,760 | $ 7,328 | 0.75 | 0.25 | 0 | Amanda |
| 12/31/2022 | 5A782577-41E7 | LeadAdvisor | $ 1,862,783 | $ - | 0.25 | 0.5 | 0.25 | Mike |
| 12/31/2022 | 5A782577-41E7 | Sales2 | $ 1,862,783 | $ - | 0.25 | 0.5 | 0.25 | Mike |
| 12/31/2022 | 5A782577-41E7 | Sales3 | $ 1,862,783 | $ - | 0.25 | 0.5 | 0.25 | Gail |
| 12/31/2022 | 84257562-FF46 | LeadAdvisor | $ 12,029,180 | $ 69,000 | 1 | 0 | 0 | Ted |
| 12/31/2022 | 84257562-FF46 | Sales1 | $ 12,029,180 | $ 69,000 | 1 | 0 | 0 | Ted |
| 12/31/2022 | B825795F-69B8 | LeadAdvisor | $ 1,388,739 | $ 9,719 | 1 | 0 | 0 | Jay |
| 12/31/2022 | B825795F-69B8 | Sales1 | $ 1,388,739 | $ 9,719 | 1 | 0 | 0 | Jay |
| 12/31/2022 | D257B373-76FB | LeadAdvisor | $ 147,278 | $ 2,256 | 0.75 | 0.25 | 0 | Amanda |
| 12/31/2022 | D257B373-76FB | Sales1 | $ 147,278 | $ 2,256 | 0.75 | 0.25 | 0 | Amanda |
| 12/31/2022 | EB5DC257-7367 | LeadAdvisor | $ - | $ 67 | 1 | 0 | 0 | Craig |
| 12/31/2022 | EB5DC257-7367 | Sales1 | $ - | $ 67 | 1 | 0 | 0 | Craig |
| 12/31/2022 | F257EAB4-1387 | LeadAdvisor | $ 278,195 | $ 2,661 | 1 | 0 | 0 | Grant |
| 12/31/2022 | F257EAB4-1387 | Sales1 | $ 278,195 | $ 2,661 | 1 | 0 | 0 | Grant |
| 12/31/2022 | FE825739-847D | LeadAdvisor | $ 877,339 | $ 6,908 | 0.5 | 0.5 | 0 | Kevin |
| 12/31/2022 | FE825739-847D | Sales1 | $ 877,339 | $ 6,908 | 0.5 | 0.5 | 0 | Kevin |