
2. Re: How to Calculate Average for a data set coming from multiple tables of the same database? (more details below)
Fadi Elmasri Feb 15, 2012 12:54 PM (in response to Alex Kerin)Alex,
Thank you very much. that has made it.
Best Regards

3. Re: How to Calculate Average for a data set coming from multiple tables of the same database? (more details below)
Fadi Elmasri Feb 15, 2012 1:55 PM (in response to Alex Kerin)Hello Alex,
thanks again for your reply on the question.
can I bug you with a follow up question on the same subject?I am now trying to do the average and total for the Customer Rating which comes from the "Call Ratings" table (onetomany relation the CallID). the average seems to work OK using the method you have showed me, but the total is summing all redundant data!!
please see tab#5 for the details
attached workbook with two new tabs.
your help is gratefully appreciate

CallsData.twbx.zip 86.4 KB


4. Re: How to Calculate Average for a data set coming from multiple tables of the same database? (more details below)
Alex Kerin Feb 15, 2012 3:03 PM (in response to Fadi Elmasri)1 of 1 people found this helpfulDoes:
IF (FIRST()==0) THEN
WINDOW_avg(avg(['Call Rating$'_CutomerRating]), 0, IIF(FIRST()==0, LAST(), 0))
END
fix it?  I don't know what you want to show with total rating

5. Re: How to Calculate Average for a data set coming from multiple tables of the same database? (more details below)
Fadi Elmasri Feb 16, 2012 7:00 AM (in response to Alex Kerin)Yes, it worked for the Average, but I am also, trying to calculate the sum of the customer rating (by Rating Level as shown in tab#5 in the workbook attached)
I have tried the following
IF (FIRST()==0) THEN
WINDOW_sum(sum(['Call Rating$'_CutomerRating]), 0, IIF(FIRST()==0, LAST(), 0))
END
but it did not give the correct answer...it did sum all redundant data.