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

Count results of formula 1

Status
Not open for further replies.

elsenorjose

Technical User
Oct 29, 2003
684
US
I am using a view in Oracle (9i) that has a field called ‘status’. The values in ‘status’ are:

INTERNAL
EXTERNAL
DECLINED

I want to create a formula that will allow me to:

Count the total ‘status’ values for a given date range;
Count EACH ‘status’ value for the date range;
Subtract each count from the total;
Give me a percentage of each status in relation to the total.

So, if I have 30 total statues of which 10 are internal, 10 are external, and 10 are declined, I would want to see something like:


TOTAL Internal External Decline Internal % External % Decline %
30 10 10 10 33% 33% 33%

Using CR 8.5
 
Create 4 Running Totals:

All
Set the field to {table.status}, type of summary to count

Internal
Set the field to {table.status}, type of summary to count
in the evaluate use a formula place:
{table.status} = "Internal"

External
Set the field to {table.status}, type of summary to count
in the evaluate use a formula place:
{table.status} = "External"

Declined
Set the field to {table.status}, type of summary to count
in the evaluate use a formula place:
{table.status} = "Declined"

Place these fields in the report footer. You can then reference them in formulas for computing your percentages, as in:

({#RTExternal}/{#rtGrand})*100

-k
 
Synapsevampire

I am not the original poster of this question but you helped me solve a problem that has been hanging over my head for days. Thank-you so much.

Vickie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top