hubbsshaun
IS-IT--Management
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.
Any help is greatly appreciated. Thanks in advance.
Shaun
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