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

Count multiple items (Discoverer Desktop Edition 4.1)

Status
Not open for further replies.

hubbsshaun

IS-IT--Management
Nov 28, 2007
7
CA
Hi all,

I am trying to have Discoverer run a very simple query, but it doesn't seem to allow me to run multiple counts within the same report. The below code was written in SQL Developer and I want to recreate it in Discoverer. I am just simply trying to get a count of the number of POs and number of PO lines created by buyer, but when I try a count of the PO lines and a count_distinct on the POs I get the correct number of lines (as it is the lowest part of the hierarchy), but I just simply get a '1' in the po_count field for each row.

Code:
select      per.full_name buyer,
            count(distinct hdr.po_header_id) po_count,
            count(lne.po_line_id) po_line_count
from        po.po_headers_all hdr,
            po.po_lines_all lne,
            apps.per_people_f per
where       hdr.agent_id = per.person_id 
            and hdr.po_header_id = lne.po_header_id 
group by    per.full_name
;

Any help is greatly appreciated. Thanks in advance.

Shaun
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top