Function stats_mode on discoverer

Good morning,
Im using Oracle Discoverer 10.1.2.1, and I need use the group functions median and stats_mode available on Oracle Database 10g release 2.
These 2 functions are not defined in Discoverer group functions.
To use median function, I founded the solution with PERCENTILE_CONT(0.5)WITHIN GROUP(ORDER BY Age).
Im trying to find a solution to use the a function with same result than stats_mode.
I tried one solution creating a group function but Discoverer didnt treats it as group function.
Is there some idea to do this?
Thanks
Emerson

Hi Emerson
If you can locate the package, presumably owned by SYS, that has thats_mode in it then we can import it into Discoverer Administrator and make it available for the end users. I have to admit that I took a littke look for it recently and could not find the package. Do you have a DBA nearby who can advise or if anyone reading this can tell us where it is I would be very grateful.
Best wishes
Michael

Similar Messages

  • Database Aggregate Functions and Oracle Discoverer

    Hello Guys.
    There are a lot of aggregate function inside the database, unfortunatelly some of them are not directly accesible from Oracle Discoverer.
    For example :
    STATS_BINOMIAL_TEST
    STATS_CROSSTAB
    STATS_F_TEST
    STATS_KS_TEST
    STATS_MODE
    STATS_MW_TEST
    STATS_ONE_WAY_ANOVA
    STATS_T_TEST_*
    STATS_WSR_TEST
    What is the best way to incorporate this kind of function in Oracle Discoverer ?
    Thanks
    Ramiro Ortiz Rios

    While Discoverer today is unable to recognize these Oracle Database functions, we are looking at adding this capability into the product. If you think this is important, please take the poll at http://oraclebi.blogspot.com/2006/04/must-have-in-discoverer.html
    Also, if you can spare a few minutes, do send me a mail at abhinav.oracle at gmail.com with a brief description of a use case that describes where and how these functions would be used.
    Thanks
    Abhinav
    Oracle Business Intelligence Product Management
    BI on Oracle: http://www.oracle.com/bi/
    BI on OTN: http://www.oracle.com/technology/products/bi/
    Documentation: http://docs.oracle.com/
    Oracle BI Suite EE: http://www.oracle.com/technology/products/bi/enterprise-edition.html
    Oracle BI Suite SE: http://www.oracle.com/technology/products/bi/standard-edition.html
    Oracle BI Suite SE One: http://www.oracle.com/technology/products/bi/standard-edition-one.html
    Discoverer: http://www.oracle.com/technology/products/discoverer/
    BI Software: http://www.oracle.com/technology/software/products/ias/devuse.html
    BI Blog: http://oraclebi.blogspot.com/
    Blogs: http://blogs.oracle.com/

  • How to find out PL/SQL function usage in Discoverer workbooks?

    We have to make changes to one PL/SQL function that has been registered in Administrator. Is it possible to find out in which reports the function is used? The function is called in calculations and it returns certain time information. We have to add one argument to the function and therefore have to change calculations where the function is called. We have too many workbooks to manually check them all.
    I am aware how to find out which folders and items are used in workbooks but can't find the same information about functions. We are using Discoverer 10.1.2.2
    Thanks in advance!

    Hi,
    If you calculation is in the EUL you can look at the item dependencies, but if your calculation is in the workbook there is no way other than using the workbook dump (d51wkdmp.exe) utility or opening the workbook and manually checking.
    You might want to consider overlaying the PL/SQL function definition so that there are 2 variants of the function. You can then add the extra parameter as an optional parameter in Discoverer. The correct variant will be called depending on how many parameters are used.
    Hope that helps,
    Rod West

  • Erroring out when trying to call a custom function from the discoverer repo

    Hi everybody, Thanks in advance....
    I have a discoverer report giving the shelf life of an item.
    The shelf life is to be calculated using a function.
    Hence, a custom function is created. I registered the function using Discoverer Administrator Edition.
    Then opened my desktop edition and opened the report.
    Going to Tools > Calculations > New > Functions > Database > selected the function and changed the parameters passed to the function by going to Items selecting the columns from the tables they are available.
    Now, when the query is refreshed, it comes up with an error "Function returns no value".
    When tested from sql session, the function returns value.
    any idea, as to whts the reason???
    -- Kiran

    Hi,
    Have you validated the function in Discoverer administrator?
    Is the function valid?
    Have you manually defined the function details or imported directly from the database?
    pls. let us know.

  • Creating cross-functional joins in Discoverer Admin

    Hello
    When creating cross-functional joins, say b/w Projects and Suppliers in Disco Admin, I import the Suppliers folder and then create the joins b/w Projects and Suppliers in the Projects Business Area.
    However, the user needs access to both Projects and Accounts Payables (has Suppliers) to access the new cross-functional report. Is there a way by which the user needs to be granted rights to Projects only but would still be able to see the cross-functional report?
    Thanks,
    Sanjib Manna
    Oracle Practice
    IBM Business Consulting Services

    Are you refering to "cross business area" joins? If so, you can have the same folder in multiple business areas. And by granting access to one business area, you grant access to all the folders in there.
    So, if you put the folder "suppliers" in both BA's (do so by choosing "manage folders" from the menu), you only have to grant access to the projects BA.
    Regards,
    Sabine

  • Use of DECODE function in Discoverer 3.1

    Hi all,
    Is there any better way of using DECODE in Discoverer 3.1, i dont want to use that function in my Discoverer User edition or Admin ed.
    Many of my queries use the DECODE function.
    Your help is greatly appreciated.

    If you created an instance of your time class that you called myTime
    var myTime:Time = new Time(15,15,0);
    and later you wanted another instance with the same time you could write
    var myTime2:Time = myTime.clone()
    It is just there for convienience and doesn't have anything much to do with MVC

  • Date Functions in Discoverer Query

    Hi,
    It has been a while since I logged into the forum. Sorry at present my contribution is only to get help. Hope to help others in future.
    Here is teh problem I am facing.
    We have frequent requirement to get the sales comparison by last year to this year
    in Week to Date, Month to Date, Year to Date timeline.
    To accomplish I use Custom Date functions in my Discoverer which results in query like below
    SELECT o100229.curr_division_code,
    SUM (DECODE (discotw_admin.fiscal_cal_by_wk.flyrweek (:fyrweek),
    o100059.fiscal_year_week, o100341.tot_lines_ext_i_s_avg_cst,
    0
    The "discotw_admin.fiscal_cal_by_wk.flyrweek (:fyrweek)" is the function I use to get the Last year week number nased on the parameter for this week number.
    But the problem with this approach is it fires the Function every time a record is read by the query which makes the query to run long time.
    Is there anyway I can use a subquery that fires the function only once and use the value of the function in the main query in Discoverer.
    I did tried to create a custom folder for the Date functions and use it in the query so that the query references the field on the cusom folder. But still I do not see any improvement in the performance.
    Thanks in advance
    Jay

    Hi Jay
    Yes, calculating like this on every row will have a drag on performance.
    Have you considered using one of the analytic functions LAG or LEAD? They are designed for this type of reporting.
    If you have considered them and rejected them can you explain why.
    Another possibility is to use a SUM analytic like this:
    SUM(Selling Price SUM)
    OVER(PARTITION BY Size,Product
    ORDER BY TO_DATE("Year",'YYYY')
    RANGE BETWEEN INTERVAL '1' YEAR PRECEDING
    AND INTERVAL '1' YEAR PRECEDING )
    The caveat here is that RANGE INTERVAL must be a YEAR and the ORDER BY must return a date!
    Does this help?
    Best wishes
    Michael

  • Function not returning value in Discoverer report

    Hi All,
    I am using a PL/SQL function in a Discoverer Report to return a particular date. The way I am using is that I have created a PL/SQL function and registered the same in Discoverer Administatrator.
    My problem is that when i run the report this function returns NULL for one particular unit but when i run the same on toad as
    'select max_term_dt_pkg.max_term_dt_fn('703813','OM - AWAITING_SHIPPING - 1179628') from dual'
    it returns the date as 26-May-2009
    Actually it should return a value in the report also.
    Can anyone guide me what could be the problem.
    Regards,
    Shruti

    Hi Rod,
    There are no session variables to be set. I have myself created that and it is returning values for other units also.
    Below is the function :
    CREATE OR REPLACE PACKAGE BODY APPS.max_term_dt_pkg
    AS
    FUNCTION max_term_dt_fn (p_unit_num VARCHAR2, p_order_status VARCHAR2)
    RETURN DATE
    IS
    l_contract_number VARCHAR2 (20);
    --okc_k_headers_b.contract_number%TYPE;
    l_max_term_date DATE; --okc_k_lines_b.date_terminated%TYPE;
    BEGIN
    IF p_order_status IN ('RMA on Unit', 'OKS 30 Days Notice Given')
    THEN
    l_max_term_date := NULL;
    ELSE
    SELECT contract_number
    INTO l_contract_number
    FROM (SELECT DISTINCT okhb.sts_code, okhb.date_terminated,
    okhb.contract_number,
    oklb_ib.attribute15 unit, okhb.start_date,
    okhb.end_date, okhb.creation_date
    FROM apps.okc_k_headers_b okhb,
    apps.okc_k_lines_b oklb_ib --,
    WHERE okhb.ID = oklb_ib.dnz_chr_id
    AND lse_id = 9
    AND oklb_ib.attribute15 = p_unit_num
    ORDER BY okhb.start_date DESC,
    okhb.creation_date DESC)
    --ORDER BY okhb.start_date DESC)
    WHERE ROWNUM = 1;
    SELECT date_terminated
    INTO l_max_term_date
    FROM (SELECT oklb.dnz_chr_id, oklb.ID, oklb.date_terminated,
    oklb.sts_code, mic.category_concat_segs,
    mic.category_set_name
    FROM apps.okc_k_headers_b okhb,
    apps.okc_k_lines_b oklb,
    apps.okc_k_items oki,
    --apps.mtl_system_items_b msib,
    mtl_item_categories_v mic
    WHERE oklb.dnz_chr_id = okhb.ID
    AND okhb.contract_number = l_contract_number
    AND oklb.lse_id = 1
    AND oki.cle_id = oklb.ID
    -- AND msib.inventory_item_id = oki.object1_id1
    -- AND msib.organization_id = oki.object1_id2
    --AND segment1 = 'OKS-RNTL-MAINT-WH'
    --AND oklb.sts_code = 'TERMINATED'
    AND oklb.date_terminated IS NOT NULL
    AND mic.inventory_item_id = oki.object1_id1
    --msib.inventory_item_id
    AND mic.organization_id = oki.object1_id2
    --msib.organization_id
    AND mic.category_set_name = 'Product'
    AND mic.category_concat_segs = 'OKS-Base'
    ORDER BY oklb.date_terminated DESC)
    WHERE ROWNUM = 1;
    END IF;
    RETURN l_max_term_date;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    RETURN NULL;
    WHEN OTHERS
    THEN
    RETURN NULL;
    END;
    END;
    Regards,
    Shruti

  • Reasons for Introducing database functions for Discoverer Reporting Needs

    Hi All,
    I would like to know the criteria other organizations have used in creating custom database functions specifically for Discoverer reporting needs. It seems good and appropriate to identify these reasons in order that they have a sufficiently good reason (e.g. in presenting this to a change management board).
    Here is a quick swipe:
    -query explain plan improvements
    -take away the complexity of having the end user deal with complex calculations
    -consistency of a value (e.g. a complex amortization calculation)
    -an attribute is used from a dependent table with a minimum cardinality of zero
    Can anyone list other good reasons in terms of Discoverer reporting?
    Thanks,
    Patrick
    Edited by: Patrick Bacon on Jul 15, 2009 10:30 AM

    Hi Patrick
    In addition to the reasons you have given the reasons for having functions anyway apply just as equally to Discoverer as they do to other applications.
    Typically the main reasons why I would use a function are:
    a) due to the complexity of the code, or
    b) to evaluate something which an end user either could not do or does not have access to.
    For example if a user needs to have aggregations from multiple tables side by side in a report, typically from tables which have no joins between them, I write functions to go get the individual results.
    One specific function that I use a lot is one that calculates the number of working days between any given two days. Some of my HR customers use such a function to calculate the number of sick days for an employee when obviously only working days should count. Doing this in a normal Discoverer calculation would be very hard. Retail customers might use this for calculating the number of days it took to ship and item.
    There are other reasons why I use functions but these are the typical ones.
    Best wishes
    Michael

  • Passing Multiple Values from a worksheet to PL/SQL function.

    Hi All,
    Is there any way to pass multiple values selected in a worksheet to a PL/SQL function ?
    I will try to explain the scenario:
    We have a crosstab report that showing all the customer details, deposit sum of a customer in each date in a date range selected. With the customer details we are showing the Rank of a customer based on the deposit in the latest date selected. Filtering is based on the rank, ie Top50 or Top60 etc.( As I said rank is calculating based on the deposit in the latest date).This is working fine.
    Now the new requirement is to : For example, in Top50 report, list all the customers, who were in the Top50 list, in any of the dates selected. We are able to display the daywise rank, but when giving a condition like daywiserank <= 50, the result becomes uncertain. Some blank lines, wrong amounts etc..
    As a work around we tried to find out the rank in a PL/SQL function. But the issue there is : we have some multiple value parameters used in the worksheet.
    Is there any way to pass multiple values selected in a worksheet to a PL/SQL function ?
    Or any other work arounds for the scenario explained?
    Reagrds,
    Jeneesh

    Hi Russ,
    Thanks for the response.
    Russ Proudman wrote:
    1. I thought there was an analytical function similar to rank - or maybe an option of rank - that if there are duplicate records to have them all considered the same rank. So if you had 3 records all the same as rank=2 then a condition saying where rank=2 would return the 3 records. You could check into this.
    We are already using DENSE_RANK. But the issue is the output contains incorrect null values nd repeated rows.
    We got it solved as I explained in the previous post. But will that AGGREGATION MODE setting ( Which discoverer says - not recommended) have any issue? I mean side effects?
    Russ Proudman wrote:
    2. Another thought is that you can create a PL/SQL routine - that's called from a SQL function registered in Discoverer - where a table is created that does the first part of your query. Then a worksheet is created to use the data from that table. So, in essence, the table would have your top50 ranked customers. Then you can write any kind of worksheet against that table. However, DBAs are loath to allow tables - that they didn't create! - many times in a PROD environment.
    Here also the same problem will occur: as the top 50 will depend upon the parameters. I cannot pass those parameters to PL/SQL Function.And storing the top50 ( itmay be top100 or to 150 also) for all combinations of the parameters is impossible
    Russ Proudman wrote:
    3. Finally, are you sure you're rank function is correct in that if you're getting blank lines, maybe the 'over' part is not considering all columns needed to determine the rank?
    Yes the query we are using is correct. The output QUERY of discoverer gives correct results in Sqlplus.
    Regards,
    Jeneesh

  • How to use Oracle OAB Fast Formulas in Discoverer-desktop [ for reporting]

    Hi,
    Can anyone tell me how to use a fast formula in discoverer-desktop [for reporting]. Currently, we have a disco-report that calcuates the 'monthly salary', but we don't want to use that. Instead, we have a custom fast-formula [xx_oab_monthly_salary] which has the conditions and calculations that we need.
    I want to use that formula in discoverer-desktop directly and get the monthly-salary.. i.e., someone needs to create a folder under the business area and add it i believe.. the formula internally calls a function.
    when i checked about this with my dba - he said, he can add the 'function', but not the formula. and i need to write the calculation part...
    does anyone know how to add it...there shud a way right...
    i do not have access to the technical-stuff here..
    someone said ["you can wrap the FF_EXEC.run_formula call into your own pl/sql function and map this function into the EUL so that the formula can be called from a workbook.", but this talks about pl/sql-do we need pl/sql
    for this].
    also, someone else said [ some fast formulas need specific contexts to be set. Depending on whether the fast formula below the only fast formula that you want to recreate in Discoverer.
    For a single formula, in general my recommendation is to recreate the fast formula instead of using the ff_exec call].
    any quick answers greatly appreciate..
    thx,

    Hi,
    That's right you need to develop the pl/sql function outside of Discoverer using a pl/sql tool or just SQL*plus. I haven't an example to hand, but can dig one up if you need it. Once you have the function developed you can map it into the EUL using Discoverer Administrator. It will then be available to Discoverer Desktop/Plus as a database function when creating calculations. So you can then just add the calculation to an existing or new report.
    Alternatively, you can build the pl/sql function into a view and load the view into a new folder using Discoverer Admin.
    Rod West

  • Regular Expressions in Discoverer 10g

    I have figured out how to use LIKE to do some basic sorting, but I would like to be able to use the regular expressions that are supposed to be built into Oracle 10g. However, I keep getting the following error message when I try to use REGEXP_INSTR, REGEXP_LIKE, REGEXP_REPLACE, and REGEXP_SUBSTR:
    Function REGEXP_LIKE has not been registered with the EUL.
    What does this mean? Do I have to get permission from the Discoverer admin to use regular expresssions in the end user layer?
    Thanks,
    Rachel

    Rachel,
    This means that these functions are not available in Discoverer.
    All available function are listed in Edit Calculation window of Calculation wizard - if you click on Functions radio button and click on '+' next to All Functions then you can see all database functions available to Discoverer and regular expression functions are not listed there.
    However, you should be able to create your own database functions using regular expressions and then register them in Discoverer. All you would do is create a function ( a wrapper) around actual regular expression functions you want to use, compile the functions in database and then register in Discoverer Admin.
    e.g.,
    create or replace function my_own_reg_replace (parameter1, paramete2 etc)
    return varchar2
    my_result varchar2(2000);
    begin
    my_result := regexp_replace(paramete1, parameter2 etc);
    return my_result
    end;
    Hope this helps.,
    Raman
    Hope this helps.

  • Discoverer 4i Plus Problem

    Hi,
    I have installed 9iAS 1.0.2.2 on Windows 2000 server which has two network ip addresses. One of the ip address is not functioning well. So the prefeences.txt file contains the functioning ip address. Also I have set this ip in the registerpreference.bat file. But still whenever I register preference, session or collector it still shows that all are registered on the non-functioning ip.
    Discovere Plus works well on the server where 9iAS is installed through IE but whenever I try to connect from other machines it gives 'Wide area network connection failed. Failed to connect to locator pointed to by locator.ior file. Local area network connection failed. Failed to connect to locator using OSAgent. Gatekeeper connection failed.'
    Please can someone help me?
    Regards,
    Roshni

    Hi Discoverer Technical Team,
    Could u pls response to that issue ?
    Thanks and regards.

  • Where-Clause with function(entered static parameter)

    Hello,
    I have no clue on the way to deal with this issue.
    Basically, for performance, I removed a join with a table, and replaced it by a call to a function within the where clause. This function only convert the entered date into an id, in order to compare with the id in the selected table.
    I knew (I think I'm right!!) that if I put a function into a where-clause, then the function is called at each row.
    As the parameter of this function is a Discoverer parameter, and therefore, it's a static value, I wanted to know whether with Discoverer, there would be a way to convert the entered Discoverer parameter value into a constant that I could use within my where-clause.
    To summarise, hete is the face of my query, at the moment:
    SELECT myColumns
    FROM myTables
    WHERE thisID < myConvertedDate(:RefDate);
    I would like to do this :
    The User enters the :RefDate, I convert it and save the result into a constant.
    Then, my query would look like :
    SELECT myColumns
    FROM myTables
    WHERE thisID < myConstantFromDate;
    I hope that my explanation is clear, and that one of you will be able to advise me.
    Thanks,
    Olivier

    Hello Nigel,
    I am not too sure that the function is called at each row. This is just my thought, from my "average" knowledge of SQL. We cannot run tkprof at the office, in order to get a better understanding.
    And also, the fact that goes towards this direction is that, when I add the call to my function in the where-clause, I have the impression that the query runs more slowly than without the call.
    I reckon that it would be great if the optimizer notices that the function is called with the same value, and returns always the same result.
    Thanks for your comments,
    Olivier

  • Procedure in Discoverer

    Hi All,
    Is there a way to use PL/SQL Procedure using DML operations in Discoverer and How ?
    Are they any events in Discoverer like Before Reports or After Report like Oracle Reports?
    - Raghav

    Raghav,
    There are no events or triggers in Discoverer.
    Take a look at the Discoverer Hints and Tips for a way to use DML in PL/SQL functions registered in Discoverer:
    http://www.oracle.com/technology/products/discoverer/htdocs/hints/htm/ADM_How_to_perform_DML_operations_in_Discoverer.htm
    Kevin

Maybe you are looking for

  • Data extraction from SAP R/3 BAPI to BW

    hi, i am extracting data from sap r/3 bapi into sap bw. can u please send me the link and documents of how to extract the data from bapi to sap bw. Answers will be rewarded Thanks sd shahid

  • How do I open a PDF file at a particular book mark

    Is it possible to create a hyperlink (shortcut) in a program, such as excel or word, that when clicked would open a PDF file in adobe (pro in my case) and open that file at a particular bookmark in that file. I couldn't find anything in the help file

  • Pick Status in order row

    Hello fellow SAP users As stated in SAP note 1036919 the pick status in sales document rows is not reliable anymore becaus the sales order row can be split into serveral picklists and might have a diffrent picking status in each list. Our customer ho

  • How can i make a song a ringtone, how can i make a song a ringtone?

    Can someone please help me how can I make my converted m4 songs into a ringtone. Also, how can i review and validate my account without entering any credit card

  • Stop printing multiple pages on one sheet

    When printing from Acrobat or Reader, the print preview and settings show that I am printing a single page on one sheet of paper. However, it actually prints two pages side-by-side on one sheet of paper. How would I stop this? This is the only progra