I have the following problem. For every job in the database we can have one or more salesperson. Example:
Job Salesperson Sales
1 1 $100
1 2 $150
1 3 $120
2 1 $300
Total sales of salesperson 1 in this case would be $100+$300=$400. However, some users are asking all the sales in which salesperson 1 participates; in my example that would be 100+150+120+300=670
In SQL:
Select sum(Sales) from Fact_Sales A
where exists (Select * from Fact_Sales B
where A.Job=B.Job
and Salesperson=1)
How do I do this? We are in version 7.2.3
Thanks, OV
Job Salesperson Sales
1 1 $100
1 2 $150
1 3 $120
2 1 $300
Total sales of salesperson 1 in this case would be $100+$300=$400. However, some users are asking all the sales in which salesperson 1 participates; in my example that would be 100+150+120+300=670
In SQL:
Select sum(Sales) from Fact_Sales A
where exists (Select * from Fact_Sales B
where A.Job=B.Job
and Salesperson=1)
How do I do this? We are in version 7.2.3
Thanks, OV