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

What approach should I take - getting percentage total ? 1

Status
Not open for further replies.

Harki06

Technical User
May 18, 2006
85
US
I want to do a report as follows -
We have unique case numbers. I need to display how many cases took < 24 hours, how many cases took < 48 hours and how many took > 48 hours. As you can see, the count of cases < 24 will come in all the 3 i.e < 24, < 48 and > 48. I need to display % totals for the 3 categories.

What approach would be ideal? Any help is appreciated. I am using CR10 and SQL server as my database.
 
We don't know what datetime fields are involved, try posting technical informtion as well with your posts to avoid us having to ask for this base need.

Since you clearly aren't after real examples, oryou would have taken some time to post tables, fields, example data and the expected output, I'll just share theory.

Perhaps there are 2 dates, one the start of the process, the second the end of the process. They can be either in the same row, or in their own (see, the guessing begins...).

I'll assume th same row in this example:

Create formulas of:

//24 hours
if datediff("h",{table.start},{table.end}) < 24 then
1
else
0

if datediff("h",{table.start},{table.end}) < 48 then
1
else
0

if datediff("h",{table.start},{table.end}) >= 48 then
1
else
0

Note your requirements says those less than 48, or greater than 48, it would omit those of exactly 48 hours.

Place these formulas in the details and select insert summary->sum

Now for the percentage of total use formulas, as in:

(sum({@My24HourFormula})/count({table.anyfield}))*100 & "%"

-k
 
My apologies. Here you go.

They are all datetime fields.

I want the end result like this
0-24 10 cases 10%
0-48 50 cases 50%
> 48 40 cases 40%

---------------------------
100 %

How would I get the report to display like this if I do as you said at the detail level setting a variable to 0 or 1.
 
Place these formulas in the details and select (right click) them and select insert summary->sum

You still didn't supply example data.

Anyway, try the above solution first.

-k
 
Ok-:) The data would just read as

Case # OpenDate CloseDate AcknowledgementTIme
2006-1 1/1/2006 1/3/2006 2(in days)
2006-2 1/1/2006 1/5/2006 4(in days)
 
I am doing it just now. Having a lot of interruptions..
 
Excellant!!! It worked-:) I put the sum of all the 3 formulae in the Report Footer one below the other to get the wanted. I used your percentage formula calculation with 3 new formulae in the Report footer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top