Board index » delphi » Statistics

Statistics

Hi

I have Delphi 5 Professional and I do not have the Decision Cube
components, but I would like to create some statistics from my Database?

I would like to create a table with 14 fields, on a Form or in a report:

Field1 = Name of the Provider
Field2 until Field13 = Total Invoice from provider for the month 1 until

12.
Field14 = Total sum of the Invoices for a year for the provider in the
Field1.

Name     1        2        3        4    ..    ..    12    Total
P1        1000   2000    1000                            x
P2        500    2541    1000                             x
.
.
Pn
Sum    x        x        x                                    XTotal

Do you know about any components or a way to do this?

Thank you in advance

Morten

  franor.vcf
< 1K Download
 

Re:Statistics


Quote
>Pn
>Sum    x        x        x                                    XTotal

>Do you know about any components or a way to do this?

Assuming a paradox table
Query the table Select Distinct on the Name field.
Save the query to a table using dbiMakePermanent
 DbiMakePermanent(query1.handle, 'temp.db',true);

Create a second query outer using an outer join with the table you have just
created to your source table.  Select for records in the first month range and
sum the invoice values.
Again save the query to a table and go on and do the same thing with the next
month

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Other Threads