Thanks for this, sorry it took so long to get back, but I was on vacation and had to wait until I could get a purchased copy of Qlickview and try out your solution. This is all good stuff, but what I'm looking for is a bit different. Let me see if I can explain.
My Dimension is Leads/Week (1, 2, 3, 4, 5, 6, etc)
For each value in Dimensions, I want to see the average close rate for every week/agent combination that has 1 lead in a week.
If I define a new variable "Agent_Week" as the AgentID + Week (1_2010/1 for example) then for agent 1 there are 2 agent weeks - 1_2010/1 and 2_2010/2, both have 2 leads, 1 close. WeekDispatches = 2, WeekIncontract = 0.5.
If this was the only agent, then the expression for Leads/Week = 1 would return 0, Leads/Week = 2 would return 50%, and the rest would return 0.
See the attached spreadsheet for expansion on this.