Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cross-Tab Averages for Entire Table in Each Cell 1

Status
Not open for further replies.

socalvelo

Technical User
Jan 29, 2006
127
0
16
US
CR 2011
Oracle DB

I am counting police incidents (or calls). Lets assume there are 1000 incidents in a one month period.
My cross-tab rows are hours-of-day increments so there are 24 rows. A formula counts how many calls fall withing an hourly time period. 00, 01, 02, 03.....all the way to 23.
My columns are the days of the week so there are 7 columns.
So we have 168 cells.

I need the averages for all 168 cells so the number of calls in each cell should be divided by the 1000 monthly calls.

When trying to calculate percentage of all calls within the cross-tab, I am only getting averages for each column or row, depending on which I choose.

I a hoping I can do this in a cross-tab rather than having to create a manual cross-tab.

Thanks for any assistance.
 
I would do it this way.

[li]Right Click the Cross Tab field and select Format Field;[/li]
[li]Click on the x2 button beside the Display String on the Common Tab;[/li]
[li]Enter the following Code:
Code:
ToText(CurrentFieldValue/Count({Table.Column})*100,1)
, where {Table.Column} is a database field you count to get the correct number. [/li]

Hope this helps.

Cheers
Pete
 
Pete,

It worked perfectly.

What is the [/li] supposed to do or is this a reference? I did not include this and it worked fine.

Thank you

Ed
 
Whoops, sorry. Ignore that bit of code (as I'm sure you worked out). It was actually a bit of surplus code from the post that inserts the bullet points.

Glad it helped.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top