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

Percentage problem with formulas

Status
Not open for further replies.

inmeres

Programmer
Dec 11, 2001
2
GB
Hi,

I have a report about cars and contracts.
The report is grouped by car make (renault, ford,etc..).
I am not showing any details.
I'm trying to use the percentage in "insert->summary".

The columns read:
|total new|perc new|total|perc total
I can insert a count() summary for "total".
I can insert a count() percentage of total cars for "perc total". That tells me that for example, 12% of cars are FORD.
For "total new" : I have a formula @isnew saying "if new then 1 else 0". I do a summary count() on that, works fine.
The problem is for the "perc new" column. I do not want to know the percentage of FORD that were new, I want to know the percentage of total cars that are NEW FORD. But the summary percentage only lets you select "percentage of sum @isnew", which is not what I want.

Is it possible to do that, and if yes, How?
Thanks very much in advance,
Guillaume

==================================
Guillaume JUSTIER
Inmeres Solutions Ltd

[w] [e] guillaume@inmeres.com
==================================
 
Hi Inmeres,

If there are not too many car makes, you could suppress all other sections and use the report footer. Using the running total editor, create two running totals for each car type, e.g., new Fords and all Fords, and a total count for all cars. Then create two formulas for each car type: 1) @%NewFords://
{#NewFords}%(count{cars})
//and 2) @%AllFords://
{#AllFords}%(count{cars})

lb



 
First, you should not be counting IsNew, you should be summing it. Count() will count the zeros as well as the ones.

Second, since you are grouped by car, I assume that you want a percentage at the end of each group. That is what a summary will do, if you select the Group by Make. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top