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

Expressing a value as a percentage.

Status
Not open for further replies.
Aug 9, 2006
17
GB
Hello,

Apologies if this is terribly obvious but I cannot get my head around this problem.

I am using Crystal Reports 9 to report on a SQL 2000 database.

I have been asked to produce a report that shows resources issued on a particular day(I am reporting on a library system). This hasn’t been a problem, however the customer has asked that the loans be grouped by catalogue location and that I display the number of items that were on loan that day as a percentage of the total items in that location – this is the aspect I am having trouble with.

In the report I am using a table called Catalogue which contains the Catalogue_Location field that the report is grouped by and a Catalogue.ID field which is used to count Catalogue records, and a query called Past Loans which contains a PastLoans.ID field used to count loans and a PastLoans.Catalogue_Location which contains the catalogue location details for that loan.


Thanks in advance,

Brenda.
 
If you have the values, it is as simple as
Code:
{value1} % {value2}

Otherwise you can get percentages using Running Totals. If you're not already familiar with Crystal totals, see FAQ767-6524.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
You should show some sample detail level data and the expected results based on that sample. We need to see how the pastloans ID field relates to the rest of the data. Just as a guess, maybe you would have some formula like {@pastloans}:

if not isnull({table.pastloansID}) then 1

Then you could create a percentage formula at the group level like this:

sum({@pastloans},{table.cataloguelocation}) % count({table.cataloguelocation},{table.cataloguelocation})

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top