Re: Reports 2.5 Medians

From: Amine Y. Tarhini <atarhini_at_ringer.cs.utsa.edu>
Date: 1997/03/16
Message-ID: <5gg43e$52p_at_ring01.cs.utsa.edu>#1/1


In article <3327774D.64BB_at_bom.gov.au> Jo Pitt <jmp_at_bom.gov.au> writes:
>We have a requirement to print summaries of numeric fields at the bottom
>of many reports.
>
>Reports handles simple things like average, sum etc. quite OK. But what

                 ^^^^^^

  I've been working with ORACLE REPORTS 2.5 for over a year now, and I   can tell you it can handle VERY complex requirements.

>if I want a median ? I could either re-read the database and calculate
>it
>myself (slow !!) but I don't want to do this ! The database is several
>gigabytes. I want to be able to re-access Reports own fields after
>printing
>them - like in re-processing an array.

  You never have to re-read the database with REPORTS. re-accessing the   reports own fields after "printing" is accomplished by having multiple   layouts. You can even produce completely different reports, each   starting with its own page numbers, from the same data model, and in   one 'run' of the report.
>
>Are there any sneaky ways to do this ? I can do it with Forms really
>easily. Why not Reports ???

  I don't know of a sneaky way. But I did try 2 straightforward ways to   get the median and they both worked. In one I used one query comprised   of a union of 2 select statement, in one statement I get the detail   records and in the other I get a count of the group rows. This was the   more complex to design. The other one was with 2 queries, a parent and   a child. In the parent query, I put 3 placeholder columns, one to hold   the median, and the other two to hold the two middle values in case the   group's count was even. Of you course you get that count in the parent   query. In the child query, I put one COUNT summary column, to hold a   running count of the detail group, and one formula column, that keeps   checking this count summary column to set the placeholder columns at   the right time, i.e. when the middle (or two middle) record(s) are   fetched.

>
>Any ideas would be really welcome !!!
>
>J.M. Pitt
>Bureau of Meteorology
>Melbourne
>Australia
>jmp_at_bom.gov.au

  I hope I've been of some help, If you have more questions, e-mail me.

-- 
Amine.
atarhini_at_ringer.cs.utsa.edu

The above views are mine only ... etc. etc.
Received on Sun Mar 16 1997 - 00:00:00 CET

Original text of this message