Pivot Table Query add Formula columns

A

ardi

Hello,

I have created my pivot table with this MS Access query ,
transform max(value)
select hour from mytable group by label
pivot label

below is the Table output from pivot table query :

Hour A B C
1 15 14 21
2 22 23 24
3 21 33 11
4 10 10 10

I would like to added one columns with this simple formula (A+B +C )/
3
so the output like this.

Hour A B C Avg
1 15 14 21 16.67
2 22 23 24 23
3 21 33 11 ....
4 10 10 10


based on that formula .. Is there
a way to do that?. Please let me know.

Thanks in advance
 
J

John Spencer

Simpler might be

TRANSFORM Max(Value) as TheMax
SELECT Hour, Avg(Value) as TheAverage
FROM MyTable
GROUP BY HOUR
PIVOT Label

By the way, posting the actual query string makes life a lot easier. Your
posted "sample" contained an error that would generate a syntax error.

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top