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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subdividing bars in a histogram 1

Status
Not open for further replies.

ChristianWhite

Programmer
Jun 14, 2004
41
US
I'm designing a histogram in Crystal XI, Win XP Professional version 2002 SP2, SQL Server 2000.

Here's how it should look when I finish:


y-axis
(Number of
Subscribers)

400

300

200

100

0


Jan,Feb,Mar-etc JFMe JFMe JFMe

0 1-20 21-40 41-60 etc.

x-axis
(Counts of Articles Downloaded Jan-Dec of current year)
further grouped by month



As you can see, a user glancing at the chart should be able to answer questions such as:

How many subscribers downloaded 1 - 20 articles in March?
How many subscribers downloaded 1 - 20 articles in April?
How many subscribers downloaded 1 - 20 articles in May?

How many subscribers downloaded 61- 80 articles in August?




So far I have been able to return a histogram with this layout:




y-axis
(Number of
Subscribers)

400

300

200

100

0


0 1-20 21-40 41-60 etc.

x-axis
(Counts of Articles Downloaded Jan-Dec of current year)




As you can see, I'm missing the subgrouping by month.

I'm still deciding how to optimally organize the stored procedure. It could return Subscriber ID, Date (e.g. first of each month), and Article Count if desired.


My question, then, is how to get Crystal to subdivide the bars for the months. I don't see such a feature. Is there a way I can design my stored procedure to get this layout? Have I missed a setting in Crystal that would enable this subdivision?



Christian
 
You should be able to use date as one "on change of" field and a formula {@count} for the count ranges as the other, with count of subscribers as your summary field. The {@count} formula would look something like:

if count({table.article},{table.subscriber}) = 0 then "0" else
if count({table.article},{table.subscriber}) in 1 to 20 then "1-20" else
if count({table.article},{table.subscriber}) in 21 to 40 then "21-40" else //etc.

-LB
 
I ended up using a bar chart instead of a histogram--with data as you described.

I was not able to get a histogram to break out the months from the article-count ranges (e.g., in the group for 1-20 articles, show the number of subscribers: a bar for January, a bar for Feb, March, etc; for 21-40 articles, do the same). I wonder if a histogram is designed for that kind of display.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top