If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Newbie - Charts - advice needed

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-15-05, 10:28
Vader Vader is offline
Registered User
 
Join Date: Mar 2004
Posts: 9
Newbie - Charts - advice needed

I have an sql query that counts the number of Codes for each hour of the day. There are 3 codes [50, 61 and 63]. The data I get from my sql 'group by' looks something like this:
Code:
Hr	Cd	Num
--	--	---
09	50	1
09	61	5
09	63	6
10	50	25
10	61	24
10	63	17
11	50	24
11	61	12
11	63	22
12	50	27
12	61	33
12	63	7
13	50	53
13	61	58
13	63	23
14	50	51
14	61	42
14	63	24
15	50	37
15	61	12
15	63	14
16	50	88
16	61	50
16	63	4
Hr is the hour, Cd is the code and Num is the count of Cd.

I wish to create a table that will display the Hour on the x-axis and the count on the y-axis. There would be a seperate bar for each code. Therefore in most cases there would be 3 bars [on for each code] for every hour.

How can I acheive this? I tried using the chart function in excel but I cant seem to get it display the data the way I want it.

I have quite alot of data so changing any of is manually is a no no.
Reply With Quote
  #2 (permalink)  
Old 02-15-05, 11:02
DavidCoutts DavidCoutts is offline
Registered User
 
Join Date: Jan 2004
Location: Aberdeen, Scotland
Posts: 1,067
I would do this with a pivotchart which you can do if you have excel 2000 or higher
that way when you create your table you can mess about with the chart to get it how you want it
what you probably want is your data organised into a table rather than a list, which a pivottable will do easily for you,

post back if you want any more clarification
Dave
Reply With Quote
  #3 (permalink)  
Old 02-15-05, 12:13
Vader Vader is offline
Registered User
 
Join Date: Mar 2004
Posts: 9
Thanks for the info. I am now playing abuot with pivot table charts to see what I can get.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On