Date Parameter in Discoverer Custom Folder

Hi All,
We have a requirement where i need to filter sql query data in the where condition as below.
WHERE 1=1
AND TRANSACTION_DATE BETWEEN :PARAMETER_DATE-90 AND :PARAMETER_DATE-9
Can anyone of you help me on achieving that in discoverer.
Thank You
gt0990

Hi,
to do that inside the custom folder you can use DB contexts, read the following :
http://learndiscoverer.blogspot.com/2008/11/metalink-note-304192.html
Re: Passing multiple parameters into Custom Folder...
Tamir

Similar Messages

  • How to Pass Multiple Parameter to Discoverer Custom Folder Created in Admin

    Hi,
    I have done as describe in doc id (metalink) note 304192.1 and it's ok.
    Now, my scope is to use the parameter declared in SETPARAMS not with the "=" condition but with "IN CLAUSE" (multipe values).
    for example (SQL Inspector):
    SELECT i106116 as E106116,i106117 as E106117,SUM(i106118) as E106118_SUM
    FROM ( SELECT DS_COMMESSA AS i106116, DS_SCENARIO AS i106117, DS_VALUE AS i106118 FROM (select ds_commessa, ds_scenario, DS_VALUE
    from dw_ods.ods_mbo_commessa
    where DS_TIPO_COSTO='COSTI MEDI'
    and ds_label='DIR'
    and cd_scenario in (1,2)
    and ds_commessa IN DW_ODS.SETPARAM.GET_PARAM1
    union all
    select 'Totale' as ds_commessa, ds_scenario, sum(DS_VALUE)
    from dw_ods.ods_mbo_commessa
    where DS_TIPO_COSTO='COSTI MEDI'
    and ds_label='DIR'
    and cd_scenario in (1)
    and ds_commessa IN DW_ODS.SETPARAM.GET_PARAM1
    group by ds_scenario
    ) CUO106102 ) o106102
    WHERE (1 IN (DW_ODS.SETPARAM.SET_PARAM1(:"Commessa")))
    GROUP BY i106116, i106117;
    where the parameter "commessa" is used with "IN" operator.
    Also tried to modifiy the SET_PARAM1 and GET_PARAM1 in order to use a "table of varchar2" ... but with no succes.
    Help please

    Rod,
    for the first "problem" I find the solution on metalink (note 304192.1) and works fine (also combining SET and GET together)... otherwise I don't know how use this "workaround"...
    for the multiple values on a single parameter (for example: Month='Jan,'Feb') I have tried to understand how DISCO pass these values to the SET function (I suppose like an array of varchar2) but don't work. After the first values (Jan) the reports stop... The problem in not how stored the values but understan how DISCO "pass/manage" these values (Jan,Feb)... Can u help me?
    my actual SETPARAMS package body is (like metalink):
    CREATE OR REPLACE PACKAGE BODY SETPARAM AS
    FUNCTION SET_PARAM1(P1 IN VARCHAR2) RETURN NUMBER IS
    BEGIN
    param1 := P1;
    return 1;
    END;
    FUNCTION GET_PARAM1 RETURN VARCHAR2 AS
    BEGIN
    return param1;
    END;
    FUNCTION SET_PARAM_MBO(p_anno IN VARCHAR2) RETURN NUMBER IS
    BEGIN
    anno := p_anno;
    return 1;
    END;
    FUNCTION GET_PARAM_MBO RETURN VARCHAR2 AS
    BEGIN
    return anno;
    END;
    END SETPARAM;
    ----------------------------------------------------------------------

  • Order by clause in discoverer custom folder

    hi,
    i m working on discoverer 3.1.38.I've been trying to sort the period according to calendar sequence and for this i tried 2-3 different queries which are working fine on sql plus but in discoverer custome folder,one error is coming saying ..can't use ORDER BY clause in custom folder.
    I've tried formatting option also but it doesn't work here with me as i preferably want to sort in MON-RR format.
    thanks in anticipation
    null

    thanks for replying back. but i didn't get what exactly u meant by creting query in user edition and about alternative sort,i should have list of value item and item_to_sort in same folder but i don't have that..i am creating one cross tab report and using to_char(gl_date,'MON-RR') format on my top axis its' appearing alphabetically over there,i wrote one qurey which worked prefecly fine on sql plus,but in discoverer its' giving me error.i can't create alternative sort on this,so please give me some different solution
    thanks in advance

  • Validating Date parameter in discoverer

    Hi
    In the discoverer is it possible to validate or restrict the users to enter the wrong format of the date e.g. if the date format to be entered is dd-mm-yyyy, the system should not allow the users to enter mm-dd-yy,
    Is it possible to put any validation?
    As of now what is happening is discoverer is not telling me any thing after running for few minutes i am not getting any result, after that if i check i found that the date is in the wrong format
    Regards
    Ramesh Kumar S

    Hi
    If I may throw an aside in here. If your users are using 10.1.2 Plus there should be no need for users to key anything into any date parameter because Discoverer now has a calendar for this use. I find it much easier to teach my users to use a calendar than to try and teach them how to key dates in correctly.
    One other thing you might want to consider if you have not already done so is to standardize a date format across your entire Discoverer installation. Then the date format will be obvious because its the same one they see all of the time.
    Nevertheless, if you still want a mechanism to trap what users are keying it is possible to create functions that trap formats displaying appropriate error messages.
    Best wishes
    Michael

  • Passing date parameters to a custom folder

    Is there any simple way to pass date parmeters to a custom folder?

    I think I recognize a question very similar to this recently.
    And it's the same situation, in that - what do you mean by passing a date?
    I understand it to mean that you want a user - at run time - to enter a date or date range that will then return only that data from a custom folder.
    1. You could have all data returned (ie: no date conditions applied to the SQL) and then filter using the Disco tool (ie: plus, viewer, desktop).
    2. If you want to 'pass' those date parameters into the actual folder in the EUL, then there is a method that you can use using functions you write.
    3. Or you could code the actual database SQL view with some kind of hard-coded date parameters (ie: SYSDATE - 30), etc.
    Russ

  • Parameter passing to custom SQL query using PL/SQL FUNCTION

    Hi
    In order to pass a parameter to the query in custom folder of a business area I created a function and mapped it to the Custome query using Discoverer Desktop. There is no error in mapping as the system does not throw any error. When I am inputting the Parameter for the input values everytime the query doesnot return any rows.
    Can anybody help in this regard

    Hi,
    I need to take the request Id as input from the user and then fetch only the data pertaining to that requet Id. As a lot of complex joins are involved I need to pass request id as parameter to the custome folder.
    The package i greated:
    CREATE OR REPLACE PACKAGE SETPARAM
    AS
    param1 varchar2(25);
    param2 varchar2(25);
    FUNCTION SET_PARAM1(p1 IN varchar2) RETURN NUMBER ;
    FUNCTION GET_PARAM1 RETURN varchar2;
    END SETPARAM;
    CREATE OR REPLACE PACKAGE BODY SETPARAM AS
    FUNCTION SET_PARAM1(p1 IN varchar2) RETURN NUMBER IS
    BEGIN
    fnd_client_info.set_org_context('138');
    param1 := p1;
    dbms_output.put_line(param1);
    RETURN 1;
    END;
    FUNCTION GET_PARAM1 RETURN varchar2 AS
    BEGIN
    RETURN param1;
    END;
    END SETPARAM;
    I registered the set_param1 function as a pl/sql function in discoverer admin.
    This function is called on the condition associated with the parameter in Discoverer Desktop when i run the report.
    In the custom folder query i have this piece in the where clause
    WHERE tnfo.request_id = NVL(APPS.SETPARAM.GET_PARAM1,7383588)
    And everytime i get the data pertaining to request id =7383588,
    Please suggest where i went wrong
    thanks
    Ashwini

  • Custom folder - basic question(s)

    Hi Everyone,
    Hope all is well...
    I am aware that one can create an
    statement and than use that to create a Discoverer custom folder.
    I was wondering when do you have a tendency to go with this approach?
    Do you do this so that you can -
    1) avoid complicated Discoverer queries - for example you want to avoid using too many analytic functions
    so you prepare the data using SQL?
    2) create a NEW Discoverer query off this custom folder
    thus this technique is like doing a query against a query
    I would like to to create a custom folder for the above 2 reasons.
    What are your opinions? tx, sandra

    Hi Sandra,
    let's clarify the terms:
    Normally you have developed your Select statement that returns the data that you need in Discoverer. Now you have two choices:
    1. send this SQL to your Disco Administrator and let him/her create a custom folder in Discoverer, where he/she uses your SQL directly (copy&paste into discoverer admin)
    2. you can use your Select statement and store it in the database and give it a name. you do this via:
    create view your_view_name
    as
    select ... from ....;
    Then you can use this view like any other table for selects:
    select * from your_view_name;
    And it will return the same results like your initial select statement. The advantage is that this view exists as an object in the DB, means everyone else can use it (for example for tests), while you as a developer maintain it.
    When you have a view, then in discoverer administrator instead of creating a custom folder you can create a "normal" folder via "New folder from Database". Then it will list all your tables and views on the database, so you select your view "your_view_name" and it will create a folder for this (each column in the view will get an item in the folder etc.)
    Regarding performance: You can not generally say that this or that performs better, since the select statement in the view and in the custom folder can be the same. However if it's in the DB as a view, then the DBA can monitor and optimize performance better, since he can see it there as an object.
    Next to that there are certain limitations to the select statements that you can use in a custom folder. You do not have these limitations in the DB Views. However those are pretty complex statements that you maybe did not miss so far...
    Regarding benefits for tests:
    The benefit with a DB view is: you create a view for your select statement and then you can ask someone else to check if it returns the correct data. They will have to do a:
    select * from your_view_name where...;
    If something is not correct, you change the view but you don't need to send them the SQL via mail again... sending SQLs via mail is something I avoid, because people always do copy&paste mistakes or the mail program does some stupid things with the code or whatever.. I prefer to keep the "implementation" (source code/select statement) hidden to the person that tests... they can validate based on the results.
    But I don't want to stress too much on this one, since normally your users should test in Discoverer, that's what they will use finally, so they should test there. And here it does not make a difference to the end users whether you have views or custom folders.
    Regarding Source Code control or "Version Control":
    We use CVS or Subversion to store our program code. So all program code is stored in such a version control system, so that you can keep track of the changes over time, see which version was installed when (we place "tags/labels" with the date of deployment on the version that is installed) etc.
    I guess you store your program code somewhere in a folder, and you use different folders for different versions or something. This is pretty nasty, CVS or Subversion or systems like this make your life easier ;)
    Regarding Automatic deployment:
    Once we have developed a certain program (statement, package, whatever) and it's working fine, then we store it as new version in our CVS (version control). Then we do a UAT (user acceptance test). IF everything is fine and approved for production, then it needs to be installed on the production server.
    For this we have a so called build&deployment system. We use ANT for this (comes from the Java community I think).
    What we do when we want to have something installed: we run a script called "build.sh" with some parameters:
    build.sh deploy_production my_project
    this means we want to deploy the program "my_project" to the production system. the rest is handled by the script:
    1. get the latest version of the program code from CVS
    2. prepare & copy all needed files to the production servers
    3. run one or more install scripts on the production servers to install everything (for example it will execute our "create view ... " script via SQLPlus)
    4. verify if installation went fine
    5. place a tag/label in CVS that this specific program version has been installed on the current date onto the production system
    You can add there some more things if you want to... of course not everything is automated at our site, for example the discoverer folders are still manually created. But this is a one time action. If you make a minor change to the DB view (no new columns) then you need to install only the new version of the View, but nothing needs to be done in Discoverer with the folder.
    Well, I could continue for a while explaining the concept more and more... But meanwhile I forgot already what the initial problem was :-D
    best regards,
    David.

  • Passing parameter to a query in Discoverer Admiin custome folder.

    I am developing a report in which I need to paa in the request Id as parameter to display the user the data corresponding to that request Id. However the query is very complex and If I am enetering the request Id in Discoverer Desktop se as Condition for the workbook created the report takes a lot of time to generate. Is there any mechanism through which I can pass the parameter directly to the Custome folder query. As this will reduce my computation time since all the joins will be done only for the rows with that given request Id rather than for all the rows which is happenning correctly.
    Thanks.

    Hi,
    Well there is no straight forward way to do that.
    There is a work around to get that functionality by using outer tables or context.
    Take a look at the following posts:
    Re: Parameters in SubQuery
    Re: Parameters in Discoverer Administration
    Re: Passing multiple parameters into Custom Folder...

  • Performance for Custom folder in Discoverer

    Hi there, thanks for all your helping questions and sharing your thoughts.
    I got issue from user regarding Custom folder in Discvoerer while they try to run report, becoz there are item classes i created and its taking so long time to fetch LOVs.
    Below is the query, I used to create custom folder and also created 3 LOVs (item classes) in Discverer Administrator, it is working well and good.
    According to the requirement ( you can see bottom of this page) this is the query, Can anyone help me on how to improve performance, in TOAD the query takes long time, so for Item classes also it takes long time. Any ideas would be greatly appreciated, thanks in advance.
    SELECT fu.user_name
    , fu.description
    , fu.start_date "User Start Date"
    , fu.end_date "User End Date"
    , frv.responsibility_name
    , frv.start_date "Resp Start Date"
    , frv.end_date "Resp End Date"
    , furg.start_date "Resp Assignment Start Date"
    , furg.end_date "Resp Assignment End Date"
    , MAX (flr.start_time) AS "Last Logon"
    , 'Y' as "Logon Flag"
    FROM apps.fnd_user_resp_groups_direct furg
    , apps.fnd_responsibility_vl frv
    , applsys.fnd_user fu
    , applsys.fnd_logins fl
    , applsys.fnd_login_responsibilities flr
    WHERE furg.responsibility_id = frv.responsibility_id
    AND fu.user_id = furg.user_id
    AND fl.user_id = fu.user_id
    AND flr.responsibility_id = frv.responsibility_id
    AND fl.login_id = flr.login_id
    GROUP BY fu.user_name,
    fu.description,
    fu.start_date,
    fu.end_date,
    frv.responsibility_name,
    frv.start_date,
    frv.end_date,
    furg.start_date,
    furg.end_date
    UNION ALL
    SELECT fu.user_name
    , fu.description
    , fu.start_date "User Start Date"
    , fu.end_date "User End Date"
    , frv.responsibility_name
    , frv.start_date "Resp Start Date"
    , frv.end_date "Resp End Date"
    , furg.start_date "Resp Assignment Start Date"
    , furg.end_date "Resp Assignment End Date"
    , NULL AS "Last Logon"
    , 'N' as "Logon Flag"
    FROM apps.fnd_user_resp_groups_direct furg
    , apps.fnd_responsibility_vl frv
    , applsys.fnd_user fu
    WHERE furg.responsibility_id = frv.responsibility_id
    AND fu.user_id = furg.user_id
    AND (fu.user_id, frv.responsibility_id ) NOT IN (
    SELECT fl.user_id, flr.responsibility_id
    FROM applsys.fnd_logins fl,
    applsys.fnd_login_responsibilities flr
    WHERE fl.login_id = flr.login_id)
    Requirement================
    We have made use of modifications to a Discoverer report called 'Oracle Users and Responsibilities'. We use the report to review Oracle users and their associated responsibilities. We would like to see if it would be possible to make another report with fields from the above SQL query. The intent is to note when users last made use of a responsibility (last logged on with a responsibility). The above query needs some revision in the fact that it currently only returns responsibilities a user has logged in with. Ideally, we would like to also return the responsibilities a user has not logged in with. If a date parameter is supplied for a report, the end-user will be able to return all users, their responsibilities, and the last time the users logged in. The attached query can specify a user or the user's creation date; ideally, one would also be able to only pick responsibilities user(s) had prior to a specified date. Thus, if they wished to run a report to return all the users and the last time they logged in with their responsibilities if they have had the responsibility for at least 90 days, he could readily do so.

    Hi,
    You could try this query, but whether it will be quicker depends on how you are using the custom folder in your reports.
    SELECT ilv.user_name
    , ilv.user_id
    , ilv.description
    , ilv."User Start Date"
    , ilv."User End Date"
    , ilv.responsibility_name
    , ilv.responsibility_id
    , ilv."Resp Start Date"
    , ilv."Resp End Date"
    , ilv."Resp Assignment Start Date"
    , ilv."Resp Assignment End Date"
    , ilv_login.start_time "Last Logon"
    , NVL2(ilv_login.user_id, 'Y','N') "Logon Flag"
    FROM (
    SELECT fu.user_name
    , fu.user_id
    , fu.description
    , fu.start_date "User Start Date"
    , fu.end_date "User End Date"
    , frv.responsibility_name
    , frv.responsibility_id
    , frv.start_date "Resp Start Date"
    , frv.end_date "Resp End Date"
    , furg.start_date "Resp Assignment Start Date"
    , furg.end_date "Resp Assignment End Date"
    FROM apps.fnd_user_resp_groups_direct furg
    , apps.fnd_responsibility_vl frv
    , applsys.fnd_user fu
    WHERE furg.responsibility_id = frv.responsibility_id
    AND fu.user_id = furg.user_id
    ) ilv
    ,(SELECT fl.user_id
       , flr.responsibility_id
       , MAX(flr.start_time) start_time
    FROM applsys.fnd_logins fl
    , applsys.fnd_login_responsibilities flr
    WHERE fl.login_id = flr.login_id
    GROUP BY fl.user_id
       , flr.responsibility_id) ilv_login
    WHERE ilv.user_id = ilv_login.user_id(+)
    AND ilv.responsibility_id = ilv_login.responsibility_id(+)Rod West

  • Parameter value in sql statement (Custom Folder)

    Hi ,
    I want to formulate a custom folder - consisting of a sql statement , inside of which there is a parameter. Then in Desktop , the users can select a number as the searching criteria and this value will replace the parameter in sql statement , as in the following:
    select CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE , SUM_POSOTITA from
    select CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE , SUM_POSOTITA , row_number() over (order by sum_posotita desc) rw  from
      (SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES ,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_AT_SINT_CLINIC A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS))
      where rw<=&p
      order by SUM_POSOTITA desc The problem is that the use of parameter , whereas in sql*plus is valid, in Discoverer is not....
    What can i do in this situation...????
    Thanks , a lot
    Simon

    However , a peculiar event happens....
    whereas the sql statement is:
    select CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE , SUM_POSOTITA,RW from
    select CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE , SUM_POSOTITA , row_number() over (order by sum_posotita desc) rw  from
      (SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES ,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_AT_SINT_CLINIC A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS
      UNION ALL
      SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_AT_SINT_EX_IATR A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS
      UNION ALL
      SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_AT_SINT_FOREON_MS A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS
      UNION ALL
      SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_GEN_SINT_KLIN A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS
      UNION ALL
      SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_GEN_SINT_EX_IATR A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS))
      order by RW ascand produces the results....
    CODE_FARMAKOU                            EMP_NAME                                                                         PACKTYPE                     PACKSIZE                  SUM_POSOTITA         RW
    1000003279                               MOXACEF                                                                          BT                           40(BLIST10X4)                       45          1
    0000014071                               DOPAMINE HYDROCHLORIDE                                                           VIAL                         5 ML X 25                           30          2
    1000016655                               KABIVEN                                                                          BT                           50ÖÕÓ.×1,7ML                        21          3
    1000014127                               DEPON VIT. C                                                                     BT                           2TUBX10                              6          4
    0000002419                               FACTREL INJECTION                                                                VIAL                         2 ML                                 5          5
    0000086289                               DETUSSIN EXPECTORANT                                                             BOT                          120 ML                               3          6
    1000016655                               KABIVEN                                                                          BT                           50ÖÕÓ.×1,7ML                         2          7
    1000014127                               DEPON VIT. C                                                                     BT                           2TUBX10                              2          8
    1000000760                               DEPON                                                                            BT                           20(BLIST2X10)                        2          9
    1000003279                               MOXACEF                                                                          BT                           40(BLIST10X4)                        1         10
    1000003279                               MOXACEF                                                                          BT                           40(BLIST10X4)                        1         11
    1000000760                               DEPON                                                                            BT                           20(BLIST2X10)                        1         12
    12 rows selectedIn Discoverer , even i select to see -as parameter- let's say the 10 first records, the system displays the 7 first records , whereas when i want to see the 1,2,3,4,5,6,7 first records the system works fine....and displays accordingly 1,2,3,4,5,6,7 first records. The problem occurs above the 8th record-as parameter selected..!!!!!
    I defined the parameter as :Rw<=:Rw
    What may be the problem...????
    SORRY!!!!! I FOUND THE PROBLEM ....!!!!
    Regards and many thanks,
    Simon
    Message was edited by:
    sgalaxy

  • How to pass parameter in where clause in custom folder?

    I have the follow query
    blue color are the parameters
    i have paste this to a custom folder
    and
    select last_update_date, creation_date
    from ra_customer_trx_all
    where trunc(last_update_date)='29-SEP-2012'
    and customer_trx_id=1109
    to another custom folder returning 1 row only and create another worksheet in the same workbook and create
    3 parameter and 2 of them pointing to the 1 row query and create calcualtion
    SET_CONTEXT('Date_From',TO_CHAR(:Date From)) and SET_CONTEXT('Date_TO',TO_CHAR(:Date To))
    and 1 condition 1= SET_PARAM3(:Period)
    but this doesnt work for me, no data return please help
    select m.party_name TENANT_NAME 
    , b.interface_line_attribute10 lease_num
    --, b.interface_line_attribute12 "PPS Number" 
    ,b.interface_line_attribute2 LOCATION_CODE
    ,flexv.description property_name
    , a2.trx_number INVOICE_NUMBER
    --, t.name "Transaction Type" 
    --, e.attribute15 "AS400 Key" 
    , b2.description "BILL_ITEM_INVOCIE_DESCRIPTION" 
    ,case when gcc.segment5 like '6%' then 'P/L'
    when gcc.segment5 like '7%' then 'P/L'
    when gcc.segment5 like '8%' then 'P/L'
    when gcc.segment5 like '9%' then 'P/L'
    else 'B/S'
    end as account_nature
    --, gcc.concatenated_segments as "Charge Account" 
    ,gcc.segment1 company_code
    ,gcc.segment2 department_code
    ,gcc.segment3 property_code
    ,gcc.segment4 business_segment
    ,gcc.segment5 account_code
    ,gcc.segment6 project_code
    ,gcc.segment7 intercom_code
    ,gcc.segment8 spare1
    ,gcc.segment9 spare2
    , b2.extended_amount BILL_ITEM_INVOICE_AMOUNT
    ,to_char(substr(ps.gl_date,4,8)) gl_period
    , b.interface_line_attribute11 bill_start_date
    , b.interface_line_attribute14 bill_end_date 
    , decode(a2.invoicing_rule_id, '-2',  
       DECODE(TO_CHAR(b.RULE_START_DATE, 'YYYYMM'), to_char(to_date(to_char(TRUNC(to_date(SETPARAM.GET_PARAM3,'yyyymm') , 'Month')-1),'DD-MON-YYYY'),'YYYYMM'), 'Current', 'In Advance'), 
       'Current') bill_nature 
    , to_char(a2.trx_date, 'DD-MON-YYYY') invoice_date
    ,pal.lease_commencement_date
    ,pal.lease_termination_date
    ,h.user_name created_by
    --, NULL as remarks 
    from ra_customer_trx_all a 
    , ra_customer_trx_lines_all b 
    , pn_leases_all d 
    , pn_tenancies_all e 
    , hz_cust_accounts l 
    , hz_parties m 
    , fnd_user h 
    , ar_payment_schedules_all ps 
    , RA_CUST_TRX_LINE_GL_DIST_ALL dist 
    , gl_code_combinations_kfv gcc 
    , AR_RECEIVABLE_APPLICATIONS_all app 
    , ra_customer_trx_all a2 
    , ra_customer_trx_lines_all b2 
    , RA_CUST_TRX_TYPES_all t 
    , fnd_flex_values_vl flexv
    ,pn_lease_details_all pal
    where  
    app.APPLICATION_TYPE = 'CM' 
    and flexv.flex_value=gcc.segment3
    and flexv.FLEX_VALUE_SET_ID=1014916
    and pal.lease_id=d.lease_id
    and app.applied_customer_trx_id = a.customer_trx_id 
    and app.customer_trx_id = a2.customer_trx_id 
    and a2.cust_trx_type_id = t.cust_trx_type_id(+) 
    and a2.org_id = t.org_id(+) 
    and b.customer_trx_line_id = b2.previous_customer_trx_line_id 
    and dist.CUSTOMER_TRX_LINE_ID = b2.CUSTOMER_TRX_LINE_ID 
    and dist.account_class = 'REV' 
    and dist.account_set_flag = DECODE(NVL(a2.invoicing_rule_id,1), -2, 'Y', 'N') 
    and gcc.CODE_COMBINATION_ID(+) = dist.CODE_COMBINATION_ID 
    and b.interface_line_attribute10 = d.lease_num 
    and d.lease_id = e.lease_id 
    and e.primary_flag = 'Y' 
    and b2.customer_trx_id = a2.customer_trx_id 
    and a2.bill_to_customer_id = l.cust_account_id 
    and l.party_id = m.party_id 
    and a2.created_by = h.user_id 
    and ps.customer_trx_id = app.customer_trx_id 
    and ps.gl_date between trunc(trunc(TO_DATE(SYS_CONTEXT('DISCO_CONTEXT','Date_From')),'MM')-1,'MM') and trunc(TO_DATE(SYS_CONTEXT('DISCO_CONTEXT','Date_To')),'MM')-1

    What exactly is wrong with the results? Can you make the report include the gl_date so that you can see exactly what is being included?
    The only way to troubleshoot this is to go back to basics. You have to be 100% certain that the parameter and calculations for the dates are working. You have granted execute permission over the function to your EUL owner - yes? What I did was create the function in a package owned by EUL_US then I had no issue with grants or permissions.
    Also, gl_date is a DATE and not a string right? I ask because if it is not a date but a string then some dates might be left out.
    Assuming you are 100% certain of the building blocks you should start by including only the gl_date and primary key from the table you are using. Once you are sure you are getting the right data you can start to add in more fields.
    I do notice you are using E-Business Suite objects. I copied the code into my system where I am not using leasing. So I commented out the references to the 3 PN tables. I got 150 rows of data when I queried using the parameter and again when I hard coded the BETWEEN for the gl_date. You do have to make sure that your EUL owner has been granted SELECT right from all the tables and views used in your code and, if you intend to share this code with someone else, you will also need to have GRANT rights.
    Try your code in a SQL tool such as TOAD and see what happens. Are you absolutely sure that every one of your transactions has an entry in the PN tables? This might be why you are not getting the results you expect. You could try, as I did, to comment those lines out and then see what happens.
    Hope this has given you enough to solve your issue
    Michael
    PS. It would be nice to know your name. You haven't used it once in your thread.

  • Discoverer "Set Date Parameter" showing error

    Hi
    I am using parameter in my discoverer desktop report. This is developed by someone but i can see the functions as mentioned in Re: Passing multiple parameters into Custom Folder... this link. Now when I am passing the input parameter to my report it is not taking and the output returned is FALSE.
    My doubt is do I need to run any function before running this sheet? But this sheet running fine in PROD. Please help me.

    Hi,
    You will have to give us some more details about the function you use and how you pass in the parameter. If you are trying to use GET_DATE_PARAM1 and SET_DATE_PARAM1 then this technique often doesn't work because you cannot get and set a parameter in the same query using functions.
    Rod West

  • Discover custom folder parameter

    Greetings everyone,
    I`m working with Oracle Discoverer Release 3.1 Admin and User Edition. I would like to pass parameters to a custom folder, have followed the steps specified in Doc ID: Note:282249.1 and Doc ID: Note:304192.1, everything works fine but when i close the workbook (User Edition) and reopen again i get the following message:
    "1 = SET_PARAM(:PARAMETER)
    Do u want to substitute another condition, ignore this message, ignore all missing items, or cancel opening this workbook", when i choose any of this option the conditon 1 = SET_PARAM(:PARAMETER) dissapeare, so i have to create it again.
    By the way, i have saved all the changes before closing the workbook. What could be happeing.??
    Thanks beforehand
    Jorge

    Jorge.
    I know if I don't say it ... someone else will. So let me be the first.
    Maybe it's because you're still using v3.1.
    All kidding aside, I figure v3.1's got to something like 5 years old now? If you could patch up to atleast 4.148 - which is still extremely old, but pretty stable, you may have more luck.
    What I'm wondering is if that note applies to v3.1 or is it something it simply won't support (ie: there were many changes made to the actual EUL and what it supports between various v3 and v4 versions).
    Russ

  • Issue with Custom data parameter in Excel Data Connection

    Hello,
    We are querying a OLAP (SSAS 2008) cube using Excel 2007 by creating a data connection to SSAS server with an extended parameter “Custom Data”. We are using custom data parameter to apply our application’s user security to filter dimension
    members in Excel’s pivot table report. We have created a pivot table in Excel and the excel is including this custom data parameter along with each request that excel is submitting to SSAS.
    However, when the user selects “Show Properties in Report” option for a dimension which is selected in Row-axis of pivot table, Excel is not including custom data parameter . Why this “Custom Data” parameter is not being included in
    the request only for this specific case?
    1. The Request which sent from Excel to SSAS when user clicks on “Show Properties in Report” option
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><Session xmlns="urn:schemas-microsoft-com:xml-analysis" SessionId="AE6B294B-4983-4010-BC5F-E0896A49ECD9"/></soap:Header><soap:Body><Discover
    xmlns="urn:schemas-microsoft-com:xml-analysis"><RequestType>DISCOVER_LITERALS</RequestType><Restrictions/><Properties><PropertyList><Content>SchemaData</Content><Format>Tabular</Format></PropertyList></Properties></Discover></soap:Body></soap:Envelope>
    2. The sample Request which sent from Excel to SSAS for all other requests
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><Session xmlns="urn:schemas-microsoft-com:xml-analysis" SessionId="74165AD6-C240-4634-92A1-61A400A3FC97"/></soap:Header><soap:Body><Discover
    xmlns="urn:schemas-microsoft-com:xml-analysis"><RequestType>MDSCHEMA_CUBES</RequestType><Restrictions><RestrictionList><CUBE_NAME>RepCube</CUBE_NAME></RestrictionList></Restrictions><Properties><PropertyList><Catalog>QAV10_12thMay2010</Catalog><Timeout>5000</Timeout><SafetyOptions>2</SafetyOptions><MdxMissingMemberMode>Error</MdxMissingMemberMode><LocaleIdentifier>1033</LocaleIdentifier><DbpropMsmdMDXCompatibility>1</DbpropMsmdMDXCompatibility><CustomData>xxxxxx</CustomData></PropertyList></Properties></Discover></soap:Body></soap:Envelope>
    As the Custom Data parameter is missing in 1st request our application logic is throwing a custom exception to Excel and Excel is not able to understand the exception message. Excel is sending the same request repeatedly (going into infinite loop) and the excel
    window is freezed. Not able to work with excel until restarting the Excel.
    Can anyone help me to resolve the above? quick help is much appriciated!
    Thanks,
    Venkat

    Venkat,
    We have a very similar issue, but there is almost no material to help us. If this gets to you, please let me know if you progressed it or whether I need to go to Microsoft for a solution
    THanks
    David

  • Unable to Create a custom folder in Discoverer Administrator

    Hi,
    I have a discoverer report which is based on on standard query(Which cant be modified).The requirement is to add a new column to it which doesn't exist in that folder.I can create a custom folder and add the column to the report,but the problem is whenever i create the folder and hit the Validate SQL button it is throwing the error " *The custom SQL entered is not valid SQL statement - ORA-00942: table or view does not exist* "
    I have all the privileges for the user and when I am trying to validate the existing queries ,it is throwing the same error .
    Discoverer Version - 4 i
    Oracle Application - 11.5.9
    Appreciate your help .
    Thanks ,
    Vijay

    Hi,
    Creating new folders should be done when you are logged on as an application user.
    If your application user does not have admin access to the EUL then log on the Disco Admin as the EUL owner and grant full admin privileges to an applications user or responsibility.
    Then logon to Disco Admin with that user or responsibility. You should then be able to create and import folders.
    Rod West

Maybe you are looking for