Can't use RSA1 to transport Query

Hello Experts,
I made some coding changes to an existing query. I generated the infoset and user group to create a transport request to send to the test system. The changes works fine in the development system but they do not work in the test system. I can see the coding changes in the test system but they are not working as in development.
From my research on this forum, the suggestion is to use RSA1 for transport, but the development system is not set up to use RSA1. Is there another way I can get this transported? or better yet, what am I not doing for the changes not to work in the transport target system?
TIA,
Lyn

hi lyn,
for that what you have to do is go to RSA1, collect the query and drag in to right side, create a request for the query and make sure that you need to collect all the query elements in that request. and go to se09 and check whether all the query elements have tracked under that request and release the request.
go to test system>STMS>import the request.
thats the way to transport the objects,hope it should work.
PLZ ASSIGN POINTS if it helpful..
regards
vadlamudi

Similar Messages

  • Can we use Result from another query in Webi using Bex uery universe?

    Hi,
    Can we use Result from another query filter option in Webi to create a report using a Bex Query universe?
    I need to create a report using two universes, one is Bex Query Universe and the other is Orcle universe. I have two queries, one is using Oracle universe; the other using Bex Query universe. I need to pass the Oracle data from the Oracle query to the Bex Query query to get the matched data from SAP Bex query.
    I used Result from another query in the query filter panel for the query using Bex query universe. But I got an error saying that 'A filter contains a wrong value. you cannot run this query. (Error: WIS 00007). The data used in the filter on both sides are the same. they are char.
    I have tested by using two queries from the same Bex query universe to see if the Result from another query filter option works. And I got the same error.
    Has anyone run into the same issue and if this is possible and what should be the solution?
    Thanks in advance!
    Edited by: BO_Haiyan on Oct 6, 2010 3:47 PM

    In that situation:
    Create two queries : Oracle and BW query.
    @ Report:
    As you have to see result set from both the Dataproviders, correct? To achieve thise one must have common dimension objects to merge them at report and use Objects those are coming from both queries to use them in single Table/Report.
    Unless you don't use Merge Dimensions, you don't get a chane to use both queries objects in single Table/Report. (It will give tooltip saying: You can't drop here -- Incompatable Objects)
    In case, if you don't have common dimensions, change object definitions to Detail objects, for those required.
    Hope it helps you.
    Thank You!!

  • How can i use index in select query.. facing problem with the select query.

    Hi Friends,
    I am facing a serious problem in one of the select query. It is taking a lot of time to fetch data in Production Scenario.
    Here is the query:
      SELECT * APPENDING CORRESPONDING FIELDS OF TABLE tbl_summary
        FROM ztftelat LEFT JOIN ztfzberep
         ON  ztfzberep~gjahr = st_input-gjahr
         AND ztfzberep~poper = st_input-poper
         AND ztfzberepcntr  = ztftelatrprctr
        WHERE rldnr  = c_telstra_accounting
          AND rrcty  = c_actual
          AND rvers  = c_ver_001
          AND rbukrs = st_input-bukrs
          AND racct  = st_input-saknr
          AND ryear  = st_input-gjahr
          And rzzlstar in r_lstar                            
          AND rpmax  = c_max_period.
    There are 5 indices present for Table ZTFTELAT.
    Indices of ZTFTELAT:
      Name   Description                                               
      0        Primary key( RCLNT,RLDNR,RRCTY,RVERS,RYEAR,ROBJNR,SOBJNR,RTCUR,RUNIT,DRCRK,RPMAX)                                          
      005    Profit (RCLNT,RPRCTR)
      1        Ledger, company code, account (RLDNR,RBUKRS, RACCT)                                
      2        Ledger, company code, cost center (RLDNR, RBUKRS,RCNTR)                           
      3        Account, cost center (RACCT,RCNTR)                                        
      4        RCLNT/RLDNR/RRCTY/RVERS/RYEAR/RZZAUFNR                        
      Z01    Activity Type, Account (RZZLSTAR,RACCT)                                        
      Z02    RYEAR-RBUKRS- RZZZBER-RLDNR       
    Can anyone help me out why it is taking so much time and how we can reduce it ? and also tell me if I want to use index number 1 then how can I use?
    Thanks in advance.

    Hi Shiva,
    I am using two more select queries with the same manner ....
    here are the other two select query :
    ***************1************************
    SELECT * APPENDING CORRESPONDING FIELDS OF TABLE tbl_summary
        FROM ztftelpt LEFT JOIN ztfzberep
         ON  ztfzberep~gjahr = st_input-gjahr
         AND ztfzberep~poper = st_input-poper
         AND ztfzberepcntr  = ztftelptrprctr
        WHERE rldnr  = c_telstra_projects
          AND rrcty  = c_actual
          AND rvers  = c_ver_001
          AND rbukrs = st_input-bukrs
          AND racct  = st_input-saknr
          AND ryear  = st_input-gjahr
          and rzzlstar in r_lstar             
          AND rpmax  = c_max_period.
    and the second one is
    *************************2************************
      SELECT * APPENDING CORRESPONDING FIELDS OF TABLE tbl_summary
        FROM ztftelnt LEFT JOIN ztfzberep
         ON  ztfzberep~gjahr = st_input-gjahr
         AND ztfzberep~poper = st_input-poper
         AND ztfzberepcntr  = ztftelntrprctr
        WHERE rldnr  = c_telstra_networks
          AND rrcty  = c_actual
          AND rvers  = c_ver_001
          AND rbukrs = st_input-bukrs
          AND racct  = st_input-saknr
          AND ryear  = st_input-gjahr
          and rzzlstar in r_lstar                              
          AND rpmax  = c_max_period.
    for both the above table program is taking very less time .... although both the table used in above queries have similar amount of data. And i can not remove the APPENDING CORRESPONDING. because i have to append the data after fetching from the tables.  if i will not use it will delete all the data fetched earlier.
    Thanks on advanced......
    Sourabh

  • Can OpenMQ use SMTP as transport in a distributed setup?

    Hello all,
    I am researching the usability of OpenMQ to provide messaging services to a number of J2EE
    servers and clients distributed in a multi-segmented network (like central office and branch offices).
    Deployment in each network segment is complete and looks like any other segment's deployment -
    they all have GlassFish app servers, database and LDAP replicas, etc. We plan to connect some
    GlassFish-deployed applications and user-interface clients with MQ services, with a broker and
    each queue's instance deployed in each network segment.
    So my first short question is: am I correct to assume that in order for OpenMQ instances to
    pass messages between clients in different network segments, all of these instances should
    be pre-configured as a single "conventional cluster"? Is this the only way? That is, there is no
    such loose coupling as in email services "I've got a (spam) message for a random recipient
    name, try to deliver it please"?
    Second, can this be implemented as a multi-tier cluster? That is, "home brokers" in different
    network segments are inter-connected as a conventional cluster (brokers with dedicated
    datastores), but in fact these "home brokers" within a network segment are implemented
    as an active-active cluster with a shared datastore (local to the segment). Can this be done?
    Third, hard and titular question is: some of the network segments have no online IP
    connection per system design, they are physically separated. There is a means of
    SMTP transport between nodes in these segments, using offline techniques, though.
    Can OpenMQ nodes exchange messages (client traffic and/or administrative traffic
    like cluster config propagation), using SMTP/POP3/IMAP instead of online connections
    such as JMS/TCP or HTTP?
    I have not found any indication of this approach in the documentation, except that GlassFish
    appservers seem to be able to implement JAX-WS over SMTP as experimentally supported.
    Thanks,
    //Jim

    Hamper wrote:
    I was wondering then, as I don't have a Time Capsule, whether it would be possible to dedicate the second HDD for exclusive use of Time Machine, backing everything up?
    Anyway, would splitting the two work and would it be easily achievable with existing tools in OS X?
    Yes, you can use the 2nd HDD with Time Machine as your TM back up drive.
    As long as you are able to format your new SSD and the HDD, you can use them independently. I would advise using Terminal and the diskutil commands to do this as Mountain Lion 10.8.3's GUI Disk Utility will see the SSD and HDD as needing to be "fixed" (drives marked in RED) and if you choose to FIX the drives your two drives will automatically be setup as a Fusion drive and all data on the drives will be lost.

  • Can you use DSUM in CFC query?

    I am trying to create a query that returns,
    Today, MTD, and YTD columns.  It can be done in Access like this:
    SELECT G.TranDate, G.Desc
    , DSum("amount","GLTest","trandate =DateSerial(2009, 2, 1)") AS Today
    , DSum("amount","GLTest","trandate >=DateSerial(2009, 2, 1) AND trandate <= DateSerial(2009, 2, 15)") AS MTD
    , DSum("amount","GLTest","trandate >=DateSerial(2009, 1, 1) AND trandate <= DateSerial(2009, 2, 15)") AS YTD
    , DSum("amount","GLTest","trandate =DateSerial(2008, 2, 1)") AS LY_Today
    , DSum("amount","GLTest","trandate >=DateSerial(2008, 2, 1) AND trandate <= DateSerial(2008, 2, 15)") AS LY_MTD
    , DSum("amount","GLTest","trandate >=DateSerial(2008, 1, 1) AND trandate <= DateSerial(2008, 2, 15)") AS LY_YTD
    FROM GLTest AS G
    WHERE (((G.[TranDate])=#2/15/2009#))
    ORDER BY 1;
    But, this is the result in an actual CFC test:
    Error Executing Database Query. 
    [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft]
    [ODBC Microsoft Access Driver] Too few parameters. Expected 2. 
    The error occurred in C:\Inetpub\wwwroot\Daily2006NoForms\CFCS\Test.cfc:
    Called from C:\Inetpub\wwwroot\Daily2006NoForms\cfcTester.cfm: line 124
    Called from C:\Inetpub\wwwroot\Daily2006NoForms\CFCS\Test.cfc: line 169
    Called from C:\Inetpub\wwwroot\Daily2006NoForms\cfcTester.cfm: line 124
    <cfquery>
    SELECT glt_trandate, glt_desc, glt_amount
    , DSUM("glt_amount", "GLTrans", "glt_trandate =#createODBCDate(toDate)#") AS MTD
    FROM GLTrans
    WHERE ((glt_trandate) = #createODBCDate(toDate)#)
    </cfquery>
    This is what is actually being sent.
    SELECT glt_trandate, glt_desc, glt_amount
    , DSUM("glt_amount", "GLTrans", "glt_trandate ={d '2009-12-02'}") AS MTD FROM GLTrans
    WHERE ((glt_trandate) = {d '2009-12-02'})

    I'll first-up concede that I have't used Access since I was at polytech.  So anything I offer up here is going to be vague, and based on recollections of reading about other people's problems with it.
    I'd usually strum up an Access DB and have a mess around with it, but I don't have MS Office installed on this machine, and I can't be arsed downloading a trial of the thing just to sort out one query.  I'm sure you understand ;-)
    Firstly, one recollection I have is that whilst the query tool in Access is quite forgiving of non-standard SQL, JDBC drivers are not.  One thing that could cause gyp is using double-quotes instead of single-quotes.  I know the Acces query tool will accept double quotes, but they're not actually valid in SQL.  So perhaps try single quotes instead.
    Also I am really surprised that you have success using CF's "ODBC date format" - eg: {d '2009-12-02'} - when Access expects dates like this: #2/12/2009#.  I know this has not worked for people in the past.  I think just '2009-12-02' might work, but don't quote me on that.  Or just do it "properly" my using a <cfqueryparam> (which as I touched on, you should be doing as a matter of course anyhow).
    That "Too few parameters" error Access spits out is a fairly ubiquitous one: it seems to be what it says whenever it sees an expression it doesn't understand.  So I would not put too much stock in that actually being the problem.
    Have you tried taking the SQL that CF is passing to the driver, and running that straight in Access's query tool?  It might give a better error.
    Of course no post about Access problems would be complete without the caveat that Access is not intended to be used as a server-based DB solution, it's a desktop app, so it's completely inappropriate to be used as a DB for a multi-user environment such as a website back-end.  So if there's any way you could possibly stop using Access and use a proper DB system, that would be the best thing to do: if, for example, you are only just starting the project and you would not take too much of a hit from swapping Access out.  It might not be an option, or it might be outwith your control, I guess.
    Adam

  • Can't use parameter in query if using another database

    Hi there, I logged on SAP Business one for company A,  and try to run the following query:
    select t0.field1 from \[company b\].\[dbo\].\[table1\] t0
    where t0.filed2 = '\[%0\]'
    And I got errors.
    If '\[%0\]' is replaced by a real value it works.
    select t0.field1 from \[company b\].\[dbo\].\[table1\] t0
    where t0.filed2 =  1234
    So you can't use parameters in a query if you're using a  database that is not your current company?
    Thanks.
    Edited by: Leslie Woodward on Feb 22, 2010 7:40 PM

    That is right. All data have to be in the same company to use '[%\]' variables.
    Thanks,
    Gordon

  • How to use Results from Another Query for SAP BW universes

    Hi Everyone,
    I have two SAP BI universes.In my First universe I have Sales Doc no (dimension) and Orderqty (Measure) and in my second universe I have Sales Doc no(Dimension) and BillQty (Measure).
    Here in my first dataprovider I have 1200 rows of data and in second dataprovider I have 75,000 rows. The report should fetch only the BillQty details that matches to corresponding  Sales doc no in first data provider.
    I want to place all these fileds into a single report like as shown.
    (Datarpovider1)                (Datarpovider1)                    (Datarpovider2)
    *Sales Doc No*               Orderqty                           BillQty
    Here I am able to generate single report using merge dimension but it is leading to performance issues. I want to restrict the values at query level by passing the First dataprovider Sales doc no to second Data provider Sales doc number using Results from Anothery Query feature so that It can fetch only the matching records.
    I tried it but it was giving the follwing error:
    A filter contains a wrong value. You cannot run this query. (Error: WIS 00007)
    How Can I get rid of this error. Can we use Results from Anothery Query option for OLAP universe. Are there any limitation on it.
    All this I am doing in Webi Rich Client.
    Appreciate your help
    Thanks &in Advance
    Kiran Saka

    Hi Kiran,
    I think the filter has a wrong operand. For example, a filter with an empty constant, or a filter that deals with numeric values is defined with an alphanumeric value.Check out for this.
    Regards,
    Neeraj

  • How to transport Query variant used in APD

    Hello Experts,
    I have created 2 query variants for a query in Development system. And, these variants are being used in APD. Now, when APD is transported to next system, query variants does not exist in next system, so cannot execute APD.
    Please let me know how can i transport the query variants.
    Note: Gone through SDN, and found, query variants can be transported through some tables.
    Please let me any other possibile sloutions for the same.
    Thanks
    Lavanya

    Hi Lavanya,
    To the best of my  knowledge, you cannot transport query variants. You have to manually create them in each system. The reason being, when you try to create variants through RSRT -> Query Variants, you are basically trying to create variants for a temporary program generated during run time!
    These run time programs do not have TADIR entries (not transportable) and hence any sub elements (like variants) created on these programs are not transportable as well.
    Actually you can export variants.Please follow the below steps:
    1. Go To TCode SE38.
    2. Execute "RSTRANSP".
    3. Input your program name.
    4. Input your variant name ie. "Z**** ".
    5. Execute.
    6. Click on continue.
    7. You should be able to create a new transport at this point.
    Hope It Helps,
    Thanks,
    Amit Kr.

  • Can we use formula column in lexical parameter in sql query ...

    hi
    can we use formula column in lexical parameter in sql query ...
    as example
    i want to give
    select * from & c_table
    forumula
    function c_table
    if :p_sort = 1 then
    return 'dept'
    else
    return 'emp'
    end;
    c_table formula column
    is this possible ...
    i have such example in oracle apps reports
    if i try in ordinary report usinf emp table it show error ..
    how we can give formula column...
    please help me in this regard...
    Edited by: 797525 on Feb 20, 2012 9:31 PM

    thanks sir,
    iam not exactly saying select * from &c_table but some thing that like columns in select stmt also will be populated in user_parameters ,there are lot of table select.......from     mtl_demand md,     mtl_system_items msi,     mtl_txn_source_types     mtst,     mtl_item_locations loc     &C_source_from &C_from_cat
    &c_source_from and &c_from_cat formula column and there are defined at report level only ......
    pl/sql code &c_source_from is
    function C_source_fromFormula return VARCHAR2 is
    begin
    if :P_source_type_id = 2 then return(',MTL_SALES_ORDERS mkts');
    else if :P_source_type_id = 3 then return(',GL_CODE_COMBINATIONS gl');
    else if :P_source_type_id = 6 then return(',MTL_GENERIC_DISPOSITIONS mdsp');
    else if :P_source_type_id = 5 then
         if :C_source_where is null then
              return NULL;
         else
              return(',WIP_ENTITIES wip');
         end if;
    else if :P_source_type_id = 8 then return(',MTL_SALES_ORDERS mkts');
    else if :P_source_type_id is null then
    return(',MTL_SALES_ORDERS      mkts,
    MTL_GENERIC_DISPOSITIONS mdsp,
    GL_CODE_COMBINATIONS gl ');
    else null;
    end if; end if; end if; end if; end if; end if;
    RETURN NULL; end;
    this is forumula column i hope that you understand what iam saying
    please help me in this regard....
    thanking you...

  • Help Required -- Can we use SQL Query to READ data from SAP MDM Tables

    Hi All,
    Please help.........
    Can we use SQL Query to READ(No Creation/Updation/Deletion  just Read) Data from SAP MDM tables directly, without using MDM Syndicator.
    Or direct SQL access to SAP MDM tables is not possible. Only through MDM Syndicator can we export data.
    Thanks in Advance
    Regards

    All the tables you create in Repository comes under A2i_CM_Tables in Database named as your repository name. So the tables names are fields of table A2i_CM_Tables. Now i tried it but cant make it.
    Now, I dont think its possible to extract all fields in tables and there values using select query. May be pure sql guy can do that or not.
    But there is no relation of data extraction and syndicator. Data is viewed in Data Manager. and you can also store data in a file from DM also.
    BR,
    Alok

  • How can I use the Rownum/Customized SQL query in a Mapping?

    Hi,
    * I need to use a Rownum for populating one of the target field? How to create a mapping with Rownum?
    * How can I use an Dual table in OWB mapping?
    * Can I write Customized SQL query in OWB? How can I achieve this in a Mapping?
    Thanks in Advance
    Kishan

    Hi Niels,
    As I'm sure you know, the conundrum is that Reports doesn't know how many total pages there will be in the report until it is all done formatting, which is too late for your needs. So, one classical solution to this problem is to run the report twice, storing the total number of pages in the database using a format trigger, and throwing away the output from the first run when you don't know the total number of pages.
    Alternatively, you could define a report layout so that the number of pages in the output is completely predictable based upon, say, the number of rows in the main query. E.g., set a limit of one, two, ... rows per page, and then you'll know how many pages there will be simply because you can count the rows in a separate query.
    Hope this helps...
    regards,
    Stewart

  • How Can I use a Variable  in Data Controls query. Frank Kindly check...

    Hii,
    I am using JDeveloper 11g ADF BC.
    My Requirement is that I hv a login screen which is taken from [http://blogs.oracle.com/shay/simpleJSFDBlogin.zip].
    I hv attached BC in this application. I want to use the login usercode in the next pages after login screen. Next screen contains 3 list items which will be populating based on the user. So I created &lt;af:selectOneChoice&gt; using the BC( Just drag & dropped the column into the page from the data controls). But in the data control i want to use this usercode for passing the condition. Now Data is coming without any condition.
    So How can I use the usercode in the Data controls query.
    When I tried to display the usercode in the next page it is showing by binding the value. its code is follows
    &lt;af:outputText value="#{backing_getUser.uid}"
    The program for checking the username & Password is follows.
    package login.backing;
    import oracle.adf.view.rich.component.rich.RichDocument;
    import oracle.adf.view.rich.component.rich.RichForm;
    import oracle.adf.view.rich.component.rich.input.RichInputText;
    import oracle.adf.view.rich.component.rich.layout.RichPanelFormLayout;
    import oracle.adf.view.rich.component.rich.nav.RichCommandButton;
    import java.sql.*;
    import java.util.List;
    import java.util.Map;
    import oracle.adf.view.rich.component.rich.output.RichMessage;
    import oracle.jdbc.OracleDriver;
    public class GetUser {
    private RichInputText uid;
    private RichInputText pid;
    private RichCommandButton commandButton1;
    private RichInputText inputText1;
    private RichInputText inputText2;
    public void setUid(RichInputText inputText1) {
    this.uid = inputText1;
    public void setPid(RichInputText inputText2) {
    this.pid = inputText2;
    public RichInputText getUid() {
    return uid;
    public RichInputText getPid() {
    return pid;
    public void setCommandButton1(RichCommandButton commandButton1) {
    this.commandButton1 = commandButton1;
    public RichCommandButton getCommandButton1() {
    return commandButton1;
    public String login_action() {
    // Add event code here...
    String user = this.getUid().getValue().toString();
    // String pass = inputText2.getValue().toString();
    String pid = this.getPid().getValue().toString();
    Connection conn;
    conn = getConnection();
    Statement stmt = conn.createStatement();
    ResultSet rset = stmt.executeQuery ("SELECT usercode FROM guser where usercode = '"+user.toUpperCase()+"' and pwd=F_TEST('"+pid.toUpperCase()+"')");
    if (rset.next()) {
    conn.close();
    return "good";
    conn.close();
    } catch (SQLException e) {
    System.out.println(e);
    return "bad";
    public static Connection getConnection() throws SQLException {
    String username = "ACCTS";
    String password = "ACCTS";
    String thinConn = "jdbc:oracle:thin:@SERVER1:1521:G5PS";
    DriverManager.registerDriver(new OracleDriver());
    Connection conn =
    DriverManager.getConnection(thinConn, username, password);
    conn.setAutoCommit(false);
    return conn;
    public void setInputText1(RichInputText inputText1) {
    this.inputText1 = inputText1;
    public RichInputText getInputText1() {
    return inputText1;
    public void setInputText2(RichInputText inputText2) {
    this.inputText2 = inputText2;
    public RichInputText getInputText2() {
    return inputText2;
    -----

    Hi,
    I didn't look at the example, but if you want to secure your application then you should use container managed security. Read this .
    Anyway, you could add this before return "good"; in your login_action()
    FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("username", user);Then, you can access this from anywhere in the application by using #{sessionScope.username}.
    Pedja

  • How can I remove ASCII text from a field when I use it in a query

    How can I remove ASCII text from a field when I use it in a query?
    I am running a select statement on a table that appears to have ASCII text in some of the fields. If I use these fields in the where statement like the code below nothing returns:
    SELECT FIELD1 FROM TABLE1 WHERE FIELD1 IS NULL
    But the field looks empty if I do a straight select without the where clause. Additionally, one of the fields has text but appears to be padded out with ASCII text, which I need to strip out before I can use this field in a where or join statement. I have tried using a trim, ltrim, rtrim, to_char, nvl, decode and nothing works. When I use excel to run the same query it looks as if these ASCII fields are boxes.
    I have asked our DBA team to see what they can do to prevent these from going into the table, but in the mean time I still need to run this report.
    Do you have any suggestions?

    Can you provide an example? I've been trying (for
    example) "select translate(' test one', ascii(' '),
    'X') from dual" with no luck.
    Thank you.To replace space, you should query like this:
    select translate(' test one', chr(32), 'X') from dual instead of select translate(' test one', ascii(' '), 'X') from dual Thanks,
    Dharmesh Patel

  • Can we use global structure while designing a query on  a multiprovider

    hai friends,
                     If i build a multiprovider on cubes for which the query design  on those cubes contains global sturctures ,
    Can i use those global structures while designing a query on a multiprovider (which contains those cubes)

    Hi Vamsi,
    The structure from the base cubes will not automatically be available for the queries created on the multiprovider. The only way to get the structure there is to copy a query from the base cube to the multiprovider. You can use transaction RSZC to do this.
    Hope this helps...

  • How can I use lead/lag in this query

    I have written this query which gives me the comparative data based on this week and next week. How can I use Lead/Lag in this query.
       WITH CURRENT_WEEK
              AS (  SELECT   QPAQ.YEAR YEAR,
                             QPAQ.SEASON SEASON,
                             REGEXP_SUBSTR (QPAQ.SERIES_NAME, '[^/]+') ACC_SERIES,
                             TO_NUMBER (QPAQ.WEEK) WEEK,
                             MAX (QPAQ.FAILURES) FAILURES
                      FROM   QAR_PLAN_ACC_QTY QPAQ, QAR_PLAN_THRESHOLD_LST QPTL
                     WHERE       QPTL.CATEGORY_ID = 7
                             AND QPAQ.YEAR = QPTL.YEAR
                             AND QPAQ.SEASON = QPTL.SEASON
                             AND QPAQ.SERIES_NAME = QPTL.MODEL_SERIES
                  GROUP BY   QPAQ.YEAR,
                             QPAQ.SEASON,
                             REGEXP_SUBSTR (QPAQ.SERIES_NAME, '[^/]+'),
                             TO_NUMBER (QPAQ.WEEK)
                  ORDER BY   REGEXP_SUBSTR (QPAQ.SERIES_NAME, '[^/]+')),
           LAST_WEEK
              AS (  SELECT   QPAQ.YEAR YEAR,
                             QPAQ.SEASON SEASON,
                             REGEXP_SUBSTR (QPAQ.SERIES_NAME, '[^/]+') ACC_SERIES,
                             TO_NUMBER (QPAQ.WEEK + 1) WEEK,
                             MAX (QPAQ.FAILURES) FAILURES
                      FROM   QAR_PLAN_ACC_QTY QPAQ, QAR_PLAN_THRESHOLD_LST QPTL
                     WHERE       QPTL.CATEGORY_ID = 7
                             AND QPAQ.YEAR = QPTL.YEAR
                             AND QPAQ.SEASON = QPTL.SEASON
                             AND QPAQ.SERIES_NAME = QPTL.MODEL_SERIES
                  GROUP BY   QPAQ.YEAR,
                             QPAQ.SEASON,
                             REGEXP_SUBSTR (QPAQ.SERIES_NAME, '[^/]+'),
                             TO_NUMBER (QPAQ.WEEK)
                  ORDER BY   REGEXP_SUBSTR (QPAQ.SERIES_NAME, '[^/]+'))
         SELECT   CURRENT_WEEK.YEAR,
                  CURRENT_WEEK.SEASON,
                  CURRENT_WEEK.ACC_SERIES,
                  CURRENT_WEEK.WEEK,
                  CURRENT_WEEK.FAILURES,
                  (CURRENT_WEEK.FAILURES - LAST_WEEK.FAILURES) FAILURES_COMPARE
           FROM   LAST_WEEK, CURRENT_WEEK
          WHERE   CURRENT_WEEK.WEEK = LAST_WEEK.WEEK(+)
       ORDER BY   CURRENT_WEEK.WEEK;Output is like this.
                    YEAR         SEASON     MODEL                     WEEK        FAILURES    Failures_COMPARE
    1     2011     SUMMER     VGP-BMS15     49     10     
    2     2011     SUMMER     VGP-BMS15     50     28       18
    3     2011     SUMMER     VGP-BMS15     51     30       2
    4     2011     SUMMER     VGP-BMS15     52     40       10Edited by: BluShadow on 06-Jan-2012 13:26
    added {noformat}{noformat} tags. Please read {message:id=9360002} to learn to do this yourself in future.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    You would jettison the entire LAST_WEEK subquery. Then replace your failure calculation with
        current_week.failure - lag(current_week.failure) over (order by current_week.year, current_week.week) as failures_compareI suppose you might want to think about renaming the sub-query as well ....
    Cheers, APC
    Edited by: APC on Jan 6, 2012 1:41 PM

Maybe you are looking for