Hi,
I have my table data in the following format
Creation_Date Salesrep opportunity id
01-jul-2012 Tim Baker 3123
01--jul-2012 Tim Baker 3124
01-jul-2012 laura j 3125
02-jul-2012 ted l 3156
.
.
.28-jul-2012 Tim Baker 3158
Basically, this table stores the sales reps who have an sales opportunity assigned to them that they are working on.
1. Now I need to get the Average opportunities by sales rep by week by month along with max and min. The problem with using the standard Avg() funtion is that it could be possible that in a given week, a sales rep has no opportunities at all. So the average does not work correctly.
2. I wanted to get the average number of optys that are created by week and assigned to a sales rep. Now if I use the average standard funtion it adds up only for the data the query returns, I dont think it takes into account if lets say the Sales rep had no opprotunities the whole week.
Thanks,
Sun