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

Display "none values" in a chart

Status
Not open for further replies.

gorros

Technical User
Feb 26, 2005
10
SE
I sort data through a function (let's call it A), that return a string value depending on a date in the database record. I then want to display the count in each group (where group is the stringvalue returned by function A), or even better the percentage for each group relative total.
The report is grouped by department, and my problem is that for some departments, only one or a few of the "date groups" get a "count", and then the graph only show that, or those, groups. I want all groups to show, even if there are no values. How do I di that?
I have tried with running totals, but then my problem is to get the percentage.
 
Please see thread767-1089708 for a method that allows you to use running totals so that you can include "missing" groups.

Please clarify what your issue is with using a percentage, by explaining what the percentage would be based on. It would help to know your group structure and whether your chart is at the group or report footer level. The more specifics you can provide, the better.

-LB
 
I have a database with patient data from a hospital, and I want to display the number of days patients are staying at the hospital. I group the duration into diferent time groups "1-3 days", "4-10",11-20"....., The user then choose a timeframe (this year, last year, last week or any desired start-stop dates). I want to display the number of patients falling into each group in a graph (the best would be as (for each time group) percent of the total during the choosen timeperiod, and if possible each bar should be colorcoded for men/women). My main problem is that some of the timegroups are empty sometimes, and instead of having the chart made up by two groups for one department and four for another..., I would like to display all groups even if they have zero "patients" in that group, so that the size (width) and position for each timegoup is the same throughout the report
 
I just tested my solution from the thread I referenced, using percentages and this works fine. Follow the steps in that post, and for the running totals (necessary to get the groups with no members), use count of {table.patientID}, evaluate using a formula, e.g., for {#dur0to10}:

{@duration} in 0 to 10 //change for each duration segment

Reset on change of group (it sounds like you are using charts per group).

When you make the shared variable formulas in the main report, use a formula like:

shared numbervar dur0to10 :=
{#dur0to10} % count({table.patientID},{table.department})
//substitute your actual group field for {table.department}

Note that is you do not have the option of choosing "do not summarize" when you add the formula fields to the chart, then choose "maximum" as the summary to get the correct values.

I'm not sure how to get the stacked breakout by sex though.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top