Discoverer Aggregation / Analytics?

Nov 29, 2010

I'm attempting to use Discoverer to create a rolling 12-month attrition report. It works fine, up to the point of trying to create a average headcount for each month in the current 12-month period over the last 12 months' each. The problem I'm encountering involves the use of the MIN() function in selecting active employees in each month, mostly due to a data-cleansing issue, which I'd hoped to bypass.

Because some invididuals have two "data conversion" records - i.e., they were converted to the new database and an additional, subsequent record re-used what should have been a unique action reason - I need to test their MIN(position start date) so as to then use their actual start against the first record, whereas I can go on to use their position start to capture their FTE for any subsequent active records.

So I created a calculation, Min Start, to hold the earliest start date for each employee:

MIN(Position.Start.Date) OVER (PARTITION BY Employee.Number ORDER BY Position.Start.Date RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)

Then I test the status of each position for each month in the report and return the FTE where it tests as active through month-end.

CASE WHEN Position.Action.Reason = 'CNV' THEN
CASE WHEN Position.Start.Date = Min Start THEN
CASE WHEN Hire.Date <= Month.End THEN
CASE WHEN Termination.Date is NULL THEN FTE

[code]...

However, I can't SUM this because nesting isn't permitted and I can't average the sum because Aggregation of Analytic functions is not allowed either. I need a different approach. Data is always going to be dirty, so coding to account for such problems means I can perform my reporting requirements without interruption for clean-ups. (I know that keeping the data clean is best and highlighting such problems brings the attention of managers and staff to rectifying and avoiding such problems, but I still need to get the results out.)

View 5 Replies


ADVERTISEMENT

Performance Tuning :: Analytics And Predicate Pushing?

Sep 20, 2012

The following sequence of simple statements shows me how Analytics and Predicate Pushing appear to work. But when I go from constant tests to a join with the same data as a row instead of a constant value, the Predicate Pushing stops.

I have a table with 9 million rows in it. It takes about 90 seconds to scan.
13:25:11 SQL>
13:25:11 SQL> select count(*) thecount from lv_pln_usge_fact ;
THECOUNT
----------
8681388

1 row selected.

Elapsed: 00:00:32.28

If I run an analytic that counts all rows in the table I can see that easy enough. This exampe as I understand it, scans the table (I know this because if for no other reason, it take 90 seconds to get an answer), then after scanning all rows, counts them and adds the count to each row. There are in fact 9500 or so rows with the values of lv_rqst shown. Instead of seeing all 9500 rows, I distinct it to get only one. See how the count shows all rows in the table.

From this we see that the predicate is not pushed into the inner query to filter rows. If it had, the analytic would have produced a number like 9500 not 9 million. I have no issue with this as this is how Analytics are documented work.

13:25:43 SQL> select distinct *
13:25:43 2 from (
13:25:43 3 select LV_RQST
13:25:43 4 ,count(*) over () thecount

[code]..

We can see how filter does happen with an analytic. We push the predicate into the inner query and all of a sudden we get a count of only those rows for the specific request. Thus we see the basics of how analytics work, particularly with respect to predicate pushing. There is not real rocket science here. The filter removed rows before the analytic counted them. This too is how Analytics are documented to work.

13:27:02 SQL> select distinct *
13:27:02 2 from (
13:27:02 3 select lv_rqst,count(*) over () thecount
13:27:02 4 from lv_pln_usge_fact
13:27:02 5 where lv_rqst = '746780192'

[code]...

So far we have been doing "all rows" analytics. Now we use a PARTITION clause to group the data. Notice the rowcount. It is the count for just the lv_rqst. Do not be fooled. This is because the PARTITION column says to synchronize the analytic count to the data for its associated row. Thus the counts will be grouped by LV_RQST. Whether we had the predicate on the outside of the query or not, for this specific lv_rqst shown we would still get this count. This is not proof that we did any filtering with the predicate lv_rqst = '746780192'.

However, notice the speed of the query. It gets done so fast, that there is no way it is scanning the table. I know there is an index that starts with LV_RQST so I conclude that the index was used which I believe means the predicate was in fact PUSHED into the inner query. Thus I think we did in fact filter the rows to just this single LV_RQST value and we also accessed the table using the predicate as well which became an index range scan instead of full table scan. My biggest point is we were able to use the index to get the data we want, not scan the table and this was made so because we added the LV_RQST column to the OVER clause as part of the PARTITION BY expression.

13:27:03 SQL> select distinct *
13:27:03 2 from (
13:27:03 3 select LV_RQST
13:27:03 4 ,count(*) over (partition by lv_rqst) thecount

[code]...

Now I add an additional column to the inner query, and an additional predicate against that column to the outer query. We know that 9539 is the count of all rows where LV_RQST='746780192' as we have seen that before above. I also know the data and know about half say Y and half say N for this indicator column. This query gives the right answer. I just put it here are additional demonstration of the way analytics work. It demonstrates that the new predicate is not pushed into the innser query to filter rows. Again this is how Analytics are documented to work.

It used the index to range scan only the rows where LV_RQST='746780192'. So only those predicates that have their columns in the anlytics OVER clause are allowed to be pushed into the query for filtering and accessing purposes.

13:27:03 SQL> col LV_PLN_USGE_DEL_IND format a20 trunc
13:27:03 SQL> select distinct *
13:27:03 2 from (
13:27:03 3 select LV_RQST

[code]...

This next query shows a little more clarity. If we add the indicator column to our OVER clause then the rowcount changes to be the number of rows where LV_RQST='746780192' AND lv_pln_usge_del_ind = 'N'. So by putting the column into the OVER expression, Oracle decides to push the predicate down into the inner query and filter the data before the analytic count is done. Again this just demonstrates for clarity how it works. I think I am describing it right anyway.

And once again the speed clearly indicates that an index range scan was done using LV_RQST='746780192'. Recall I said there is an index that starts with this column.

13:27:03 SQL> select distinct *
13:27:03 2 from (
13:27:03 3 select LV_RQST
13:27:03 4 ,LV_PLN_USGE_DEL_IND

[code]...

NOW WE COME TO MY PROBLEM.Instead of using the constant value '746780192' we are going to create a one column one row table that has this value in it. We are then going to join to the the analytic subquery instead of doing a contant test against it.

13:27:03 SQL> create table kevt1
13:27:03 2 (
13:27:03 3 lv_rqst varchar2(10) not null
13:27:03 4 )
13:27:03 5 /

Table created.
Elapsed: 00:00:00.06
13:27:03 SQL>
13:27:03 SQL> insert into kevt1 values ('746780192')
13:27:03 2 /

1 row created.
Elapsed: 00:00:00.00
13:27:03 SQL>
13:27:03 SQL> commit
13:27:03 2 /

Commit complete.
Elapsed: 00:00:00.00
This query is in my mind the same query we did before but we loose the use of the index and go back to doing a FULL TABLE SCAN.
13:27:03 SQL> select distinct x.*
13:27:03 2 from (
13:27:03 3 select LV_RQST

[code]...

For a little bit more clarity, two more queries. Pay attention to how long it takes, and to how the additional joins affect things. Notice, particularly with the last statement, that the join criteria is being pushed into the inner query with the analytics. Otherwise how did it get that count?

14:55:21 SQL> select distinct x.*
14:56:16 2 from (
14:56:16 3 select LV_RQST
14:56:16 4 ,LV_PLN_USGE_DEL_IND

[code]...

So after looking at all this, here is my question: How do I get Oracle the use the index and nested loop join to the table lv_pln_usge_fact. We know Oracle pushes the predicates down when the columns are referenced in the OVER expression because we see that in several places. We also know the CBO can do a nested loop join with index access on LV_RQST because it does it when we use a constant test. But it won't use the index and nested loop when we do a join to a table with the same data, no matter how much rewriting or hinting I do.

I tested this in 9i/10g/11g and got same behavior in all three places.

View 18 Replies View Related

SQL Subquery And Aggregation

Nov 6, 2010

I have a database containing the following after entering the following sql command

SELECT TITLES.TITLE_ID AS TITLE_ID, (PRICE * SALES),
TITLES.ROYALTY_RATE AS ROYALTLY_RATE,
AUTHOR_TITLES.ROYALTY_SHARE AS ROYALTY_SHARE,
AUTHORS.FNAME AS FNAME, AUTHORS.LNAME AS LNAME
FROM TITLES, AUTHOR_TITLES, AUTHORS
WHERE TITLES.TITLE_ID = AUTHOR_TITLES.TITLE_ID
AND AUTHORS.AU_ID = AUTHOR_TITLES.AU_ID

TIT (PRICE*SALES) ROYALTLY_RATE ROYALTY_SHARE FNAME LNAME
--- ------------- ------------- ------------- --------------- ---------------
T01 12446,34 ,05 1 Sarah Buchman
T02 190841,7 ,06 1 Sarah Buchman
T03 1025396,65 ,07 1 Christian Kells
T04 168882,99 ,08 ,6 Hallie Hull
T04 168882,99 ,08 ,4 Klee Hull
T05 1400008 ,09 1 Klee Hull
T06 225834 ,08 1 Wendy Heydemark
T07 35929790 ,11 ,5 Wendy Heydemark
T07 35929790 ,11 ,5 Klee Hull
T08 40950 ,04 1 Kellsey
T09 69750 ,05 1 Kellsey

TIT (PRICE*SALES) ROYALTLY_RATE ROYALTY_SHARE FNAME LNAME
--- ------------- ------------- ------------- --------------- ---------------
T10 1 Wendy Heydemark
T11 752042,77 ,07 ,3 Hallie Hull
T11 752042,77 ,07 ,3 Klee Hull
T11 752042,77 ,07 ,4 Kellsey
T12 1299012,99 ,09 1 Wendy Heydemark
T13 313905,33 ,06 1 Sarah Buchman

17 rows selected.

What I need to do is create a subquery and use Aggregation to list the author receiving the greatest royalties on revenue. so i used the command to get the royalties

SELECT TITLES.TITLE_ID AS TITLE_ID, (PRICE * SALES),
AUTHORS.FNAME AS FNAME, AUTHORS.LNAME AS LNAME,
((PRICE * SALES) * TITLES.ROYALTY_RATE * AUTHOR_TITLES.ROYALTY_SHARE) AS ROYALTIES
FROM TITLES, AUTHOR_TITLES, AUTHORS
WHERE TITLES.TITLE_ID = AUTHOR_TITLES.TITLE_ID
AND AUTHORS.AU_ID = AUTHOR_TITLES.AU_ID

TIT (PRICE*SALES) FNAME LNAME ROYALTIES
--- ------------- --------------- --------------- ----------
T01 12446,34 Sarah Buchman 622,317
T02 190841,7 Sarah Buchman 11450,502
T03 1025396,65 Christian Kells 71777,7655
T04 168882,99 Hallie Hull 8106,38352
T04 168882,99 Klee Hull 5404,25568
T05 1400008 Klee Hull 126000,72
T06 225834 Wendy Heydemark 18066,72
T07 35929790 Wendy Heydemark 1976138,45
T07 35929790 Klee Hull 1976138,45
T08 40950 Kellsey 1638
T09 69750 Kellsey 3487,5

TIT (PRICE*SALES) FNAME LNAME ROYALTIES
--- ------------- --------------- --------------- ----------
T10 Wendy Heydemark
T11 752042,77 Hallie Hull 15792,8982
T11 752042,77 Klee Hull 15792,8982
T11 752042,77 Kellsey 21057,1976
T12 1299012,99 Wendy Heydemark 116911,169
T13 313905,33 Sarah Buchman 18834,3198

17 rows selected.

So how do I add up the royalties values associated with each author and find the max? for example I add klee hulls's royalties from each book and get 2,123,336.32(doing it by hand on calculator) what is the sql to find the max royalties for each author? P.S the answer should be KLEE HULL with 2,123,336.32

View 6 Replies View Related

SQL & PL/SQL :: Aggregation Two Different Columns Based On Same Condition?

Apr 3, 2011

I have a result-set which has 4 columns like (Region, PaymentDate, DebitAmt, CreditAmt). This result-set will always have a maximum of one month's records in it.

Suppose, imagine i have data for a month (ex, Mar 1 to Mar 31)...

Now... to aggregate (sum) the amount columns (DebitAmt, CreditAmt) in my resultset based on different date ranges, i wrote a sql like below...

Quote:
SELECT
REGION,
SUM(CASE WHEN PAYMENTDATE BETWEEN MAR 1 AND MAR 15 THEN DebitAmt ELSE 0 END) AS Debit_H1,
SUM(CASE WHEN PAYMENTDATE BETWEEN MAR 1 AND MAR 15 THEN CreditAmt ELSE 0 END) AS Credit_H1,

[code]...

My doubt is, in the above query, to aggregate two different columns based on same condition, i am checking the same condition twice...

View 2 Replies View Related

Write Function That Receives Department Name / Aggregation Operation

Sep 13, 2012

I have to write function that receives department name and an aggregation operation (average, maximum, minimum) and apply the operation on the salary of employees working on the given department and return the result.

here is my select statement:

select distinct d.deptno, d.deptname, max(e.salary)
from employee e join department d
on e.deptno=d.deptno
where d.deptname=upper('finance')
group by d.deptno, d.deptname;
[code]...

View 3 Replies View Related

Reports & Discoverer :: Launching Discoverer Viewer From Forms Menu

Dec 6, 2011

Is it possible to link to Discoverer Viewer from Forms without requiring the user to log in again. If so, can I then link to a specific Workbook within Discoverer?

View 2 Replies View Related

Reports & Discoverer :: Oracle Apps Data Does Not Show In Discoverer

Mar 19, 2012

When running my query in sql developer, I have to execute the command apps.fnd_global.apps_initialize(user_id, resp_id, resp_appl_id) in order to show the result of my query. Without this, the query returns nothing. The problem is I am using this query as a custom query for my Discoverer report and my report does not show any record.

View 3 Replies View Related

Reports & Discoverer :: Discoverer Admin - How To Copy Folder From One Instance To Another

Nov 9, 2011

I need to copy my discoverer report from dev to prod. How should I do this? Are the items created using calculation in the report can also be copied? These items are not present in the folder in discoverer admin.

View 1 Replies View Related

Reports & Discoverer :: During Open Report The Discoverer Application Frozen?

Jun 23, 2010

When I try to manage the report the Discoverer application frozen.

View 5 Replies View Related

Reports & Discoverer :: How To Create Aging Report In Discoverer

May 28, 2010

[Message #1] how to get a unapplied receipts for ageing report? and RMA(credit and debit note)columns ?

Which tables should be refered for Ageing reports.

[Message #2] How to create an ageing report in discoverer?

Which tables should be refered for a Ageing reports.

Ageing report colums customer name, customer id,location,segment, credit note and debit note in different column,unapplied amount and applied amount in a different colum.Already i got a due remaning date and total amount I want a linked table names.

View 1 Replies View Related

Reports & Discoverer :: Arabic Font In Discoverer 10g

Oct 1, 2013

we have upgraded our discoverer from 3i to 4i and from 4i to 10g. After that we faced a strange problem related to arabic font

when opening discoverer desktop and open the list of the saved reports. some reports that was saved by an Arabic name are display by name '????'(question marks)

also another issue when opening it . It open normal but some columns that are Arabic are displayed in this way (ßÇÑÊ-ÇíÌíÈÊ Êáì ßÇÑÏ- ÝÆÉ 100 Ìã). so i must change the column font from "tahoma" to "arial" or any other font that support Arabic.

- my NLS_lANG =american_america.ar8mswin1256
- this problem didnot happens on the discoverer 3i

View 4 Replies View Related

Reports & Discoverer :: ORA-00920 Error In Discoverer

Jun 17, 2008

While executing the query i got an error saying "ORA-0092 - invalid sql query"

SELECT
S.user_je_source_nameSource,
B.nameBatch_Name,
B.default_effective_dateBatch_Eff_date,
B.posted_dateBatch_Posted_Date,
B.default_period_nameBatch_Period,
[code].......

View 2 Replies View Related

Reports & Discoverer :: Privileges In Discoverer Administrator?

Nov 29, 2011

We are using Discoverer 10g, apps mode EUL. I have assigned administrator privileges to System Administrator responsibility using EUL_US as well as SYSADMIN (re-did with SYSADMIN, just in case). I have 2 Business Areas in EUL and gave access to both of them to System Administrator responsibility and the userid TESTER (this user already has System Administrator responsibility assigned to it). But when I login to Administrator using TESTER and System Administrator, I don't see any business Areas available to select.

View 3 Replies View Related

Reports & Discoverer :: Discoverer Divide By Zero

Mar 11, 2007

I am using Oracle Discoverer Plus and I have some columns in the database table that periodically take the zero value. I have to use that column to divide other values. Is there any way I can handle this to show "0" when it is divided by zero?

Discoverer Plus shows that PL/SQL functions can be used in calculations. But I can't find the Register PL/ SQL function option in the Tools menu.

View 6 Replies View Related

Reports & Discoverer :: How To Run Discoverer Reports In A Forms Menu

Jul 5, 2010

how to Run a Discoverer Reports in a Forms Menu.

View 2 Replies View Related

R12.1.1 Web Discoverer Setup?

Aug 1, 2010

I want to setup Web based Discoverer 10g on Oracle EBsuite 12.1.1.Is there any way to do this without installing a separate Oracle Application Server 10g Home????.The EBsuite 12.1.1's Oracle Application Server version is 10.1.3.

View 3 Replies View Related

Automate Discoverer 10g R2 With No Interaction?

May 20, 2011

I'm trying to create an install script to install Discoverer 10g R2 with its needed patch and opatches applied without any user interaction. I've already created the necesary response files and a batch file to sequence it. The installer should work when the it is placed on a server with the main folder shared and it does so flawlessly.

the user sees a dos window which is kindly stating that he has to wait for the primary installer to finish before hitting enter to start the patch installer.The problem I'm having is that, on slow networks, it takes a while for the primary installer of discoverer 10g to show up a window and of course the user isn't always patient enough to wait for it and hits enter before the primary installer is showing itself causing the patch installer to start before discoverer is completely installed.

Is there a way to avoid this? Or am I wrong in using a batch file to sequence this install? second problem is the needed interaction while applying opatches, can this be automated as well?

here is the contents of my batch file:

net use x: /delete
net use X: \\servername\Oracle_cd\disco10gr2 /persistent:no
@ECHO off
cls
:start

[code]....

View 12 Replies View Related

Reports & Discoverer :: How To Set Pagesize

Sep 23, 2010

I am creating a report using EMP table . At Runtime User Input deptno ,and report shows him data from that Deptno .Output vary from deptno ,Sometime It returns 6 ,5 Or 3 Rows .

But I want the pagesize to be same for every query . Wheather its returning 1 rows ,It should print on Full page .

View 2 Replies View Related

Reports & Discoverer :: Migrate From 6i To 11g?

Jun 27, 2011

migrating reports 6i to reports 11g. I did some reading up and only found the the document Upgrading Oracle Forms 6i to Oracle Forms 11g 11g Release 1 (11.1.1) E10394-01 which talk about forms migration. I am looking for a reports migration and found no good documentation on it.

1) Can I migrate to 11g directly or should i migrate to 10g first.

2) Can I use the migation assitant for reports migration or is it only for the forms.

3) If i need to recompile the reports in 11g is there a a 11g developer suite that i should use for it.

View 4 Replies View Related

Reports & Discoverer :: How To Run Two Different Queries

Aug 27, 2010

how to run two different Queries In One Report.

View 7 Replies View Related

Reports & Discoverer :: Add New Field To RTF

Dec 1, 2010

I am using Oracle 11.5.10 ebusiness suite.I have modified a custom report (an rdf) that it now picks up field xx for the address rather than POH_ SHIP_ ADDRESS_LINE1..I modified the template.rtf and uploaded it using the responsibility Oracle XML publisher. However instead of getting the field value in the report. I get XX (i.e. the field name not the field value). How can I ensure that the report picks up the value?

View 2 Replies View Related

Reports & Discoverer :: How To Run Developer 10g

Dec 27, 2010

how to run oracle developer 10g report and what a runtime file extation and where i save my reports

View 1 Replies View Related

Reports & Discoverer :: Unable To Run Sql In 3.0?

Oct 20, 2010

I am having the following sql but unable to run in Report 3.0

SELECT LIC_NO, RO_NO, RO_DTIME, HANDLED_BY,ROW_NUMBER()
OVER (PARTITION BY HANDLED_BY ORDER BY RO_NO) AS emp_id
FROM mss_veh_input_test;

View 3 Replies View Related

Reports & Discoverer :: Errors RDF To REP

May 25, 2010

I'm using it with MICROS and I want to edit an "RDF" then convert to an "REP" I have edited it but when I try to compile it it gives errors such as "statement ignored" or "must be declared". What these error messages mean!

If I do nothing to them and then try to save it as an REP i get a pop up error "REP-0736 there exists uncompiled program unit(s)" then i press OK and get an error reading "REP1430 cannot create REP file for file "uk_conf_lorne(name of my file)". Compilation errors found.

View 12 Replies View Related

Reports & Discoverer :: Order By?

Jan 28, 2011

One of my columns consists of room numbers ie: room 1, room 2, these can range from 1 - 99. Now, it is very important that I am able to order these rooms, howver when i try to order them, as you may imagine it goes like just take these following data examples. The way I have wrote them is the current way in which they are displayed:

conference room 1
conference room 11
conference room 2
dinning room 1

[code]...

But I want them to be displayed as the following when i decide to order by room:
conference room 1
conference room 2
conference room 11
dinning room 1

[code]...

The data output will vary depending on parameters passed into it so it may not always be the above data.

View 7 Replies View Related

Reports & Discoverer :: Convert RDF To REP

Mar 29, 2012

I am using reports builder 6i version. I have couple of reports developed in RDF format and it is working fine in Oracle apps 11.5.10 server.

I converted the RDF to REP(using File->Administration->Compile) for some security reasons and moved this .REP to same Oracle Apps 11.5.10 Server but the program ends up with this below error.

REP-0002: Unable to retrieve a string from the Report Builder message file.
REP-1439:

View 1 Replies View Related

Reports & Discoverer :: Use Of Xml Element In 6i?

Nov 6, 2012

i want to display values of same column with comma seperation like this

SELECT RTRIM(XMLAGG(XMLELEMENT(e,DESCR_INDI || ',')).EXTRACT('//text()'),',') INTO DESCR FROM
STUDENT_SKILL_PER WHERE GROUP_NAME=:GROUP_NAME
AND SKILL_NAME=:SKILL_NAME AND SUB_SKILL_NAME=:SUB_SKILL_NAME
AND TERM=:TERM AND STUDENT_CODE=:STUDENT_CODE AND YEAR_CD=:YEAR_CD;

but the error shown to me that xmlelement must be declared...but when i deploy same query at sql editor it gives me correct result..how i can use it on oracle report 6i... i am using oracle 9i as database.

View 1 Replies View Related

Reports & Discoverer :: Generate PDF 11g?

Mar 28, 2012

during the migration to 11g we had a problem with pdf font.

In 10g oracle report the pdf are generated correctly while in 11g all the character are shrink in the pdf file.

I attached the same file generate with oracle reports 10g.

View 3 Replies View Related

Reports & Discoverer :: GP Percentage In Total

Jan 10, 2012

See the attached pdf the output of my report. I want to calculate the GP at the Total column.

My GP formula is

trunc((profit) / decode(ACTUAL,0,1,ACTUAL)*100,2).

I tried using Placeholder Column & Formula Column but it is not working. I am using grouping in INV_DATE and summing all the columns.

View 22 Replies View Related

Reports & Discoverer :: How To Add Fields From Another Database To EUL

Sep 9, 2010

I am trying to add fields from an SQL server database to the EUL. We have a lot of Oracle tables and fields in the existinging EUL, and we have created a database link from the Oracle database to the SQL database. But how can I find til SQL database tables and fields in Discoverer admin?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved