Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Calculations with variables and DBcalc

edited September 2003 in General
Hi,

I have a query with a set of software and departments. Each software is used
by different departments (Purchasing, Sales, ...)
For example:
----------------------------------------
|Word |
|----------------------------------------|
|Group Header Software[1] |
|----------------------------------------|
|Purchasing No. of soft used : 3 |
|----------------------------------------|
|Group Header Department[2] |
|----------------------------------------|
|Detail |
|----------------------------------------|
| DBcalc : Sum (No. of soft used) |
|----------------------------------------|
|Group Footer Department[2] |
|----------------------------------------|

In the DBCalc, I have the sum of no. of soft used. I want for each
department calculate the percent of software used.
The calculation is simple, No of used * 100 / Sum (No. of used). I try to
use a variable to do this.
The problem is that DBCalc value in calculation is not the sum but the
partial sum depending on the line.
I explain with an example :
----------------------------------------------------------------------------
----------------------------
Purchasing No. of soft used : 3 Result 0 (3*100/0 !!)
Percent should be : 3*100/10 = 30
Sales No. of soft used : 6 Result 200 (6*100/3)
Percent should be : 6*100/10 = 60
Human Resources No. of soft used : 1 Result 11 (1*100/9)
Percent should be : 1*100/10 = 10
-----------------------------------group header :
department---------------------------------------------
----------------------------------detail------------------------------------
-------------------------------
Sum(No.of soft used) = 10 (DBCalc)
--------------------------------------------group footer :
department--------------------------------------

Do you have any ideas to help me ?
Thanks,

Emilie

Comments

This discussion has been closed.