Rank function used in Evaluate-aggr in RPD gives error

Hi,
In RPD, in my fact table for a logical column in BMM, I have, EVALUATE_AGGR(‘RANK() OVER (PARTITION BY %2 ORDER BY %1 DESC)’ AS INTEGER,”main”.”proj_date”,”main”.”project_id”)
but in answers when I use this as a filter and say equal to 1, I am getting the following error ‘Window Functions are not permitted’
Thanks for your time and help.

hi,
your syntax seems to be wrong not sure.Try with sum function
EVALUATE_AGGR('DB_Aggregate_Function(%1)',{comma separated Expression})
Windows functions : http://developer.postgresql.org/pgdocs/postgres/tutorial-window.html
Thanks,
saichand.v

Similar Messages

  • HT1212 iPhone diabled, tried to use iTunes to restore, but iTunes gives error message (0XE8000084). Now what to try to reset iPhone?

    iphone disabled, tried to use iTunes to restore, but iTunes gives error message (0XE8000084). How to restore iPhone?

    Try here   =   http://support.apple.com/kb/TS3221

  • @Rank function using EVALUATE

    Hi short question,
    I'm trying to get the @rank function to work in combination with OBIEE 10.1.3.4 (using EVALUATE). Anyone here already tried using this with Essbase version 9.2? In some of the documentation it states this can not be done using anything below Essbase 9.3 but the @Rank function is available within v9.2 Is there any limit on using this from the OBIEE side?
    I used this reference:
    (how to:) http://oraclebizint.wordpress.com/2008/04/28/oracle-bi-ee-101332-handling-sort-order-in-hyperion-essbase-931-evaluate-and-mdx/
    (Essbase 9.2 doc --> @Rank available) http://download.oracle.com/docs/cd/E12032_01/doc/epm.921/html_techref/techref.htm
    Evaluate function I'm trying to launch is:
    EVALUATE(’RANK(%1.dimension.currentmember,%2.members)’ AS INTEGER,Period."PeriodGen4",Period."PeriodGen4")
    Am I doing something wrong here, or am I trying to do things which can't be done?
    Thanks in advance,
    Mathijs

    I tried the syntax
    EVALUATE ('RANK(%1,%2)' as integer,"Account"."Gen4,Account Default","Account"."Gen4,Account Default")
    but still i am getting the error as:-
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 96002] Essbase Error: Syntax error in input MDX query on line 6 at token 'RANK' (HY000)
    SQL Issued: SELECT s_0, s_1, s_2, s_3, s_4, s_5, s_6, s_7 FROM ( SELECT 0 s_0, "FINRPTC#1"."Account"."Gen3,Account Default" s_1, "FINRPTC#1"."Account"."Gen4,Account Default" s_2, "FINRPTC#1"."FinancialYear"."Gen2,FinancialYear" s_3, "FINRPTC#1"."Period"."Gen3,Period" s_4, EVALUATE ('RANK(%1,%2)' as integer,"FINRPTC#1"."Account"."Gen4,Account Default","Account"."Gen4,Account Default") s_5, "FINRPTC#1"."FINRPTC"."Actual" s_6, REPORT_AGGREGATE("FINRPTC#1"."FINRPTC"."Actual" BY "FINRPTC#1"."Account"."Gen3,Account Default","FINRPTC#1"."Account"."Gen4,Account Default","FINRPTC#1"."FinancialYear"."Gen2,FinancialYear","FINRPTC#1"."Period"."Gen3,Period") s_7 FROM "FINRPTC#1" WHERE (("FinancialYear"."Gen2,FinancialYear" = 'FY12') AND ("Period"."Gen3,Period" = 'Nov') AND ("Account"."Gen3,Account Default" = 'Net Cost of Services')) ) djm

  • Rank function use in MDX

    Hi Expert,
    Could you please let me know how can I use rank function in MDX to achieve the result in below format. Highest value should be ranked as 1
    Actual/Expected Dataset appears as:
    Thanks Chandan

    Hi C,
    You can use the mdx RANK() function. For example, this query has ranking of cities by sales amount. You could create two sets, and two calcs with RANK() functions for your challenge.
    WITH
    SET OrderedCities AS Order
    ([Geography].[City].[City].members
    , [Measures].[Reseller Sales Amount], BDESC
    MEMBER [Measures].[City Rank] AS Rank
    ([Geography].[City].CurrentMember, OrderedCities)
    SELECT {[Measures].[City Rank],[Measures].[Reseller Sales Amount],[Measures].[City Rank]} ON 0
    ,[Geography].[City].[City].MEMBERS
    ON 1
    FROM [Adventure Works]
    Hope that helps,
    Richard

  • Using predefined WSDL for synchronous client gives error

    Generated a new BPEL project and attached our own WSDL (channelInterface.wsdl) to the client partner link. Specified the one and only operation in the receive and reply activities and auto created the variables in each. All simple stuff and the 'validate' reports 0 errors but upon a Project 'make' the following errors are reported.
    Rather surprised as this seems to be very simple but the generated code does not seem to auto resolve the types. Any help much appreciated.
    Error(19): [Error ORABPEL-10007]: unresolved messageType [Description]: in line 19 of "C:\temp\bpel\Test\BPELProcess1\BPELProcess1.bpel", WSDL messageType "{http://xmlns.oracle.com/BPELProcess1}BPELProcess1RequestMessage" of variable "inputVariable" is not defined in any of the WSDL files. [Potential fix]: Make sure the WSDL messageType "{http://xmlns.oracle.com/BPELProcess1}BPELProcess1RequestMessage" is defined in one of the WSDLs referenced by the deployment descriptor.
    The generated .bpel code is:
    <process name="BPELProcess1" targetNamespace="http://xmlns.oracle.com/BPELProcess1" xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20" xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:ns1="http://channel.abi.ukps.sbs" xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:client="http://xmlns.oracle.com/BPELProcess1" xmlns:bpelx="http://schemas.oracle.com/bpel/extension" xmlns:ora="http://schemas.oracle.com/xpath/extension" xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"><!-- ================================================================= --><!-- PARTNERLINKS --><!-- List of services participating in this BPEL process --><!-- ================================================================= -->
    <partnerLinks><!--
    The 'client' role represents the requester of this service. It is
    used for callback. The location and correlation information associated
    with the client role are automatically set using WS-Addressing.
    -->
    <partnerLink name="ch" partnerLinkType="ns1:ChannelInterface_PL" myRole="ChannelInterface_Role"/>
    </partnerLinks><!-- ================================================================= --><!-- VARIABLES --><!-- List of messages and XML documents used within this BPEL process --><!-- ================================================================= -->
    <variables><!-- Reference to the message passed as input during initiation -->
    <variable name="inputVariable" messageType="client:BPELProcess1RequestMessage"/><!-- Reference to the message that will be sent back to the
    requester during callback
    -->
    <variable name="outputVariable" messageType="client:BPELProcess1ResponseMessage"/>
    <variable name="Receive_1_SubmitApplication_InputVariable" messageType="ns1:AbISubmissionRequestMessage"/>
    <variable name="Reply_1_SubmitApplication_OutputVariable" messageType="ns1:AbISubmissionResponseMessage"/>
    </variables><!-- ================================================================= --><!-- ORCHESTRATION LOGIC --><!-- Set of activities coordinating the flow of messages across the --><!-- services integrated within this business process --><!-- ================================================================= -->
    <sequence name="main"><!-- Receive input from requestor.
    Note: This maps to operation defined in BPELProcess1.wsdl
    --><!-- Asynchronous callback to the requester.
    Note: the callback location and correlation id is transparently handled
    using WS-addressing.
    -->
    <receive name="Receive_1" partnerLink="ch" portType="ns1:ChannelInterface" operation="SubmitApplication" variable="Receive_1_SubmitApplication_InputVariable" createInstance="yes"/>
    <reply name="Reply_1" partnerLink="ch" portType="ns1:ChannelInterface" operation="SubmitApplication" variable="Reply_1_SubmitApplication_OutputVariable"/>
    </sequence>
    </process>
    The deployment descriptor (bpel.xml) is:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <BPELSuitcase>
    <BPELProcess id="BPELProcess1" src="BPELProcess1.bpel">
    <partnerLinkBindings>
    <partnerLinkBinding name="ch">
    <property name="wsdlLocation">ChannelInterfaceRef.wsdl</property>
    </partnerLinkBinding>
    </partnerLinkBindings>
    </BPELProcess>
    </BPELSuitcase>

    when you create a new process (and not choose empty type) we create input and output variables for you
    <variable name="inputVariable" messageType="client:BPELProcess1RequestMessage"/>
    and those still point to the old messagetypes ..
    The easiest way is on you left down side in jdev, when the bpel process is opened in the diagram mode you should see the structure (structure pane).. expand variables node and edit those 2 variables, within them right click on the part named payload and choose the new messagetype it is supposed to have
    hth clemens

  • How to use "Rank" function  in Oracle?

    I need to display Top 15 records by using rank function.
    Here is my query...I need to pull top 15 FAQ's using the below query.. How can I use RANK function to display the Top 15 FAQ"s in the list.
    Select  distinct SUb1.FAQ,Sub1.FAQ_Hits,GU.display_Name_FMLS as displayname,ev.ParentLinkrecordid,ev.userid from User GU
    Join Event ev
    ON LOWER (ev.userid) IN (LOWER (GU.lanid), LOWER (Gu.racfid))
    Join (Select distinct sm.stem as FAQ,Sum(ev.Eventresults) as FAQ_Hits,ev.ParentLinkrecordid as Topic_ID from Event ev
    Join SubjectMatter sm
    ON (TO_CHAR (sm.smrecordid) = ev.eventdetail1) AND ev.eventdetail1 IS NOT NULL AND sm.smtype = 1
    Where (Upper(ev.eventsubtype) in (Upper('FAQ'),Upper('OPENFAQ')))
    AND TO_DATE (eventdatetime, 'yyyy-mm-dd hh24:mi:ss') >= TO_DATE ('20100601', 'yyyymmdd')
    and TO_DATE (eventdatetime, 'yyyy-mm-dd hh24:mi:ss') <= TO_DATE ('20100831', 'yyyymmdd')
    Group by sm.stem,ev.Parentlinkrecordid
    order by FAQ )sub1
    ON Sub1.Topic_ID = ev.ParentLinkrecordid)

    A few bits that I noticed in the query ...
    in (Upper('FAQ'),Upper('OPENFAQ'))1) Do you really a upper for a string which is already in upper case.
    Select distinct sm.stem as FAQ,Sum(ev.Eventresults) as FAQ_Hits,ev.ParentLinkrecordid as Topic_ID2) Do you need a distinct when you are using a GROUP function viz. SUM ?
    You rank query is as follows, I am not very good at the ANSI style JOIN so changed it slightly ... :-)
    Also notice the usage rank function in the "sub1" query.
    select distinct sub1.faq,
                    sub1.faq_hits,
                    gu.display_name_fmls as displayname,
                    ev.parentlinkrecordid,
                    ev.userid
    from user gu, event ev,
      (select rank() over (order by sum(ev.eventresults) desc) rnk,
              sum(ev.eventresults) as faq_hits,
              sm.stem as faq,         
              ev.parentlinkrecordid as topic_id
         from event ev, subjectmatter sm
        where (to_char(sm.smrecordid) = ev.eventdetail1)
          and ev.eventdetail1 is not null
          and sm.smtype = 1
          AND upper(ev.eventsubtype) in ('FAQ', 'OPENFAQ')
          and to_date(eventdatetime, 'yyyy-mm-dd hh24:mi:ss') >= to_date('20100601', 'yyyymmdd')
          and to_date(eventdatetime, 'yyyy-mm-dd hh24:mi:ss') <= to_date('20100831', 'yyyymmdd')
        group by sm.stem, ev.parentlinkrecordid
        order by faq) sub1
    where lower(ev.userid) in (lower(gu.lanid), lower(gu.racfid))
      and sub1.topic_id = ev.parentlinkrecordid)
      and sub1.rnk <= 15;Like mentioned above, some sample data would have helped.

  • Prob in using rank in pl/sql ,need logic same of rank function in any way

    I have a query as of the following <br>
    <br>
    SELECT sr_no,cod_acct_no,dat_arrears_due,amt_arrear_due<br>
    FROM ( select cod_acct_no,dat_arrears_due,sum(amt_arrears_due) <br>amt_arrear_due,rank() over (partition by cod_acct_no order by <br>dat_arrears_due asc) sr_no<br>
              from arrears_table <br>
              where amt_arrears_due > 0<br>
    and dat_arrears_due <= to_date('31/10/2006','dd/mm/yyyy')<br>
    and COD_ARREAR_TYPE = 'C'<br>
         group by cod_acct_no,dat_arrears_due<br>
         ) Z <br>
    WHERE z.sr_no <=5 <br>
    <br>
    I have to use this in a cursor in pl/sql but because i have rank analytic function <br>
    I am facing a compilation error ORA-06550: error <br>
    <br>
    Can you give me a logic which gives same output as of above <br>
    <br>
    Regards<br>
    vamsi krishna<br>
    <br>
    <br>

    [1]: (Error): ORA-06550: line 5, column 28: PLS-00103: Encountered the <br>symbol "(" when expecting one of the following: , from <br>
    <br>
    My oracle version is <br>
    Oracle8i Enterprise Edition Release 8.1.6.0.0 - Production<br>
    PL/SQL Release 8.1.6.0.0 - Production<br>
    CORE 8.1.6.0.0 Production<br>
    TNS for 32-bit Windows: Version 8.1.6.0.0 - Production<br>
    NLSRTL Version 3.4.1.0.0 - Production<br>
    <br>I think it is comming for rank function it self <br>
    <br> will this version support analytic (rank) function's in pl/sql cursors<br>
    Regards<br>
    vamsi krishna<br>

  • Using the Rank() function in 8i

    I have a table that holds multiple transactions and amounts for each person (each person uniquely identified by an id). For simplicity's sake, the let's say that the table only has four columns and looks like this:
    PID NUMBER(8)
    TID VARCHAR2(10)
    AMT NUMBER(14,2)
    CMPN VARCHAR2(10)
    I need to be able to sum the various rows by person, and then calc the total sum(amt)of various percentages of people from the table, for example - What is the total/combined sum(amt) for the top 10% of the people, 'top' meaning people with the highest sum(amt)?
    Of course I know how many rows I need to sum, because I know how many distinct people exist.
    Unfortunately, I can't use RowId, because the order by is executed after the RowId limiting clause, not before, so the query would limit the rows, but not the right rows. Rank should evaluate what I need, and then I'd like to only select rows > a certain rank.
    I've tried the following:
    select cid, sum(amt),
    rank() over (partition by cmpn order by sum(amt))
    from tableA
    group by cid
    but get this error:
    rank() over (partition by cmpn order by sum(amt))
    ERROR at line 2:
    ORA-00979: not a GROUP BY expression
    CMPN is actually the same value for all the rows in this instance, but I added because I couldn't get the query to run even this far without partitioning by something.
    I also couldn't use 'where RANK > NNN' - error on that too - invalid column was the error, as though I didn't already know that column didn't exist in my table...
    ANY help or ideas at all would be greatly appreciated...

    I have been struggling with the same thing. As far as I can
    tell, the syntax simply is not powerful enough. Teradata and
    IBM, for example, allow the user to append a 'Qualify' statement
    to the Rank() command. 'Qualify' allows the query writer
    to 'qualify' how many rows are to be returned, similarly to the
    way you were trying to access a variable called RANK.
    I did have some luck using subqueries, but I would much prefer
    to do this all in one command. I am hoping that Ratio To Report
    may help overcome this problem, since it apparently ties
    together multiple analytic statements.

  • How to use RANK function ?

    Hello everyone,
    here is the query I run in sql developer using RANKFunction.
    SELECT Empno, Ename, Job, Mgr, Hiredate, Sal
    FROM
    (SELECT Empno, Ename, Job, Mgr, Hiredate, Sal,
    *RANK*() OVER
    (ORDER BY SAL Desc NULLS LAST) AS Emp_Rank
    FROM Emp
    ORDER BY SAL Desc NULLS LAST)
    WHERE Emp_Rank < 6;How I can use this query in my report in obiee or is there any replacement of RANK() function in obiee so that I can use that to get my same above result.
    Thanks

    Kuldip wrote:
    Thanks, you are absolutely correct. However, By doing this I am getting my output as whic I was not expecting.
    Students Marks Rank
    student1 95 1
    student2 95 1
    student3 93 3
    student4 93 3
    student5 91 5
    The output should be as instead
    Students Marks Rank
    student1 95 1
    student2 95 1
    student3 93 2
    student4 93 2
    student5 91 3
    Can It be done like this ?
    Thanks.
    Edited by: Kuldip on Mar 15, 2012 11:51 PMHi Boss,
    I think you copied the above scenario from this site..
    http://oracle-bi.siebelunleashed.com/articles/rank-and-dense-rank-functionsobiee/
    Then why asking how to do this? Are you testing us? Doesn't that site say how to achieve this?

  • Sql tuning using rank function

    Hi,
    Can someone help me in writing the below qry using rank() function?
    DELETE FROM stc_calllog_ext a
    WHERE a.stc_save_status = 'CT'
    AND ROWID IN (SELECT a.ROWID
    FROM stc_calllog_ext a, calllog_ext b
    WHERE a.prod_line_code= b.prod_line_code
    AND a.brand_code = b.brand_code
    AND a.model_number = b.model_number
    AND a.stc_save_status != b.stc_save_status
    AND trunc(a.stc_start_time) = trunc(b.stc_start_time)
    AND a.stc_start_time BETWEEN TRUNC(SYSDATE-8) AND TRUNC(SYSDATE)
    AND a.call_taker_userid = b.call_taker_userid
    AND a.cons_telephone_no =b.cons_telephone_no
    )

    With the information you have provided, I've come up with the following.
    SELECT A.ACCOUNT_NO, A.PAYMENT_TYPE, A.INSTALLMENT_TYPE, A.DATE_CHANGE
    FROM
        (SELECT account_no, payment_type, installment_type, date_change,
                LEAD( (payment_type), 1)
                     over (partition by account_no order by account_no, DATE_CHANGE)  LEAD_PAY,
                LEAD( (installment_type), 1)
                     over (partition by account_no order by account_no, DATE_CHANGE)  LEAD_INST
          from T_ACCNTS ) A
    WHERE A.PAYMENT_TYPE <> NVL(A.LEAD_PAY,99)
       OR A.INSTALLMENT_TYPE <> NVL(A.LEAD_INST,99)
    ORDER BY 1, 4;

  • Error using Rank function in Answers

    Hi All,
    Am trying to generate a report in Answers which lists Top Accounts with Revenue.
    I Ranked the Revenue field and it is returning me correct values. ( Rank(account.revenue) )
    But, when I try to filter on this field and restrict the rows which shows only top 10 Accounts, it is returning the following error:
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17001] Oracle Error code: 1792, message: ORA-01792: maximum number of columns in a table or view is 1000 at OCI call OCIStmtExecute. [nQSError: 17010] SQL statement preparation failed. (HY000)
    Can any one help me on this.
    Thanks in Advance,
    Imtiaz.

    Hi Joe,
    This is the Physical query generated when I use Rank function and the report is fine.
    select distinct D1.c1 as c1,
    D1.c2 as c2,
    D1.c3 as c3,
    D1.c4 as c4,
    D1.c5 as c5,
    D1.c6 as c6,
    D1.c7 as c7,
    D1.c8 as c8,
    D1.c9 as c9,
    D1.c10 as c10,
    D1.c11 as c11,
    D1.c12 as c12,
    D1.c13 as c13,
    D1.c14 as c14,
    D1.c15 as c15
    from
    (select D1.c1 as c1,
    D1.c2 as c2,
    D1.c3 as c3,
    D1.c4 as c4,
    D1.c5 as c5,
    D1.c6 as c6,
    D1.c7 as c7,
    D1.c8 as c8,
    D1.c9 as c9,
    D1.c10 as c10,
    D1.c11 as c11,
    D1.c12 as c12,
    D1.c13 as c13,
    D1.c14 as c14,
    D1.c15 as c15
    from
    (select Case when D1.c1 is not null then Rank() OVER ( ORDER BY D1.c1 DESC NULLS LAST ) end as c1,
    D1.c2 as c2,
    D1.c3 as c3,
    D1.c1 as c4,
    D1.c4 as c5,
    D1.c5 as c6,
    D1.c6 as c7,
    D1.c7 as c8,
    D1.c8 as c9,
    D1.c9 as c10,
    D1.c10 as c11,
    D1.c11 as c12,
    D1.c12 as c13,
    D1.c13 as c14,
    D1.c14 as c15,
    ROW_NUMBER() OVER (PARTITION BY D1.c1, D1.c2, D1.c3, D1.c4, D1.c5, D1.c6, D1.c7, D1.c8, D1.c9, D1.c10, D1.c11, D1.c12, D1.c13, D1.c14 ORDER BY D1.c1 ASC, D1.c2 ASC, D1.c3 ASC, D1.c4 ASC, D1.c5 ASC, D1.c6 ASC, D1.c7 ASC, D1.c8 ASC, D1.c9 ASC, D1.c10 ASC, D1.c11 ASC, D1.c12 ASC, D1.c13 ASC, D1.c14 ASC) as c16
    from
    (select distinct T690.SUM_REVN_AMT as c1,
    T690.NAME as c2,
    T2216.NAME as c3,
    T690.X_PETROFAC_REVN as c4,
    T690.SUM_WIN_PROB as c5,
    T690.X_PERCENT_GET as c6,
    T690.SUM_WIN_PROB * T690.X_PERCENT_GET / nullif( 100, 0) as c7,
    T690.X_EC_PRIORITY as c8,
    T19028.LOGIN as c9,
    T690.X_COUNTRY as c10,
    T690.X_REGION as c11,
    T18311.NAME as c12,
    T18641.NAME as c13,
    T18238.NAME as c14
    from
    SIEBEL.S_BU T18238 left outer join (
    SIEBEL.S_USER T19028 left outer join (
    SIEBEL.S_OPTY T690 left outer join SIEBEL.S_STG T2216 On T690.CURR_STG_ID = T2216.ROW_ID) left outer join SIEBEL.S_ORG_EXT T1189 On T690.PR_DEPT_OU_ID = T1189.ROW_ID) left outer join SIEBEL.S_ORG_EXT T18311 /* Competitor */ On T690.PR_CMPT_OU_ID = T18311.ROW_ID) left outer join SIEBEL.S_ORG_EXT T18641 /* Partner */ On T690.PR_PRTNR_ID = T18641.ROW_ID) left outer join SIEBEL.S_POSTN T19114 On T690.PR_POSTN_ID = T19114.PAR_ROW_ID) left outer join SIEBEL.S_OPTY_BU T18280 On T690.ROW_ID = T18280.OPTY_ID) left outer join SIEBEL.S_OPTY_X T19415 On T690.ROW_ID = T19415.PAR_ROW_ID) On T19028.PAR_ROW_ID = T19114.PR_EMP_ID) On T18238.ROW_ID = T18280.BU_ID
    ) D1
    ) D1
    where ( D1.c16 = 1 )
    ) D1
    order by c1 desc
    But When I apply Filter on this Rank column then it gives me the error. THis is the Physical query for that
    select distinct Case when D1.c1 is not null then Rank() OVER ( ORDER BY D1.c1 DESC NULLS LAST ) end as c1,
    D1.c2 as c2,
    D1.c3 as c3,
    D1.c1 as c4,
    D1.c4 as c5,
    D1.c5 as c6,
    D1.c6 as c7,
    D1.c7 as c8,
    D1.c8 as c9,
    D1.c9 as c10,
    D1.c10 as c11,
    D1.c11 as c12,
    D1.c12 as c13,
    D1.c13 as c14,
    D1.c14 as c15
    from
    (select D1.c1 as c1,
    D1.c2 as c2,
    D1.c3 as c3,
    D1.c4 as c4,
    D1.c5 as c5,
    D1.c6 as c6,
    D1.c7 as c7,
    D1.c8 as c8,
    D1.c9 as c9,
    D1.c10 as c10,
    D1.c11 as c11,
    D1.c12 as c12,
    D1.c13 as c13,
    D1.c14 as c14
    from
    (select T690.SUM_REVN_AMT as c1,
    T690.NAME as c2,
    T2216.NAME as c3,
    T690.X_PETROFAC_REVN as c4,
    T690.SUM_WIN_PROB as c5,
    T690.X_PERCENT_GET as c6,
    T690.SUM_WIN_PROB * T690.X_PERCENT_GET / nullif( 100, 0) as c7,
    T690.X_EC_PRIORITY as c8,
    T19028.LOGIN as c9,
    T690.X_COUNTRY as c10,
    T690.X_REGION as c11,
    T18311.NAME as c12,
    T18641.NAME as c13,
    T18238.NAME as c14,
    Case when T690.SUM_REVN_AMT is not null then Rank() OVER ( ORDER BY T690.SUM_REVN_AMT DESC NULLS LAST ) end as c15
    from
    SIEBEL.S_BU T18238 left outer join (
    SIEBEL.S_USER T19028 left outer join (
    SIEBEL.S_OPTY T690 left outer join SIEBEL.S_STG T2216 On T690.CURR_STG_ID = T2216.ROW_ID) left outer join SIEBEL.S_ORG_EXT T1189 On T690.PR_DEPT_OU_ID = T1189.ROW_ID) left outer join SIEBEL.S_ORG_EXT T18311 /* Competitor */ On T690.PR_CMPT_OU_ID = T18311.ROW_ID) left outer join SIEBEL.S_ORG_EXT T18641 /* Partner */ On T690.PR_PRTNR_ID = T18641.ROW_ID) left outer join SIEBEL.S_POSTN T19114 On T690.PR_POSTN_ID = T19114.PAR_ROW_ID) left outer join SIEBEL.S_OPTY_BU T18280 On T690.ROW_ID = T18280.OPTY_ID) left outer join SIEBEL.S_OPTY_X T19415 On T690.ROW_ID = T19415.PAR_ROW_ID) On T19028.PAR_ROW_ID = T19114.PR_EMP_ID) On T18238.ROW_ID = T18280.BU_ID
    ) D1
    where ( D1.c15 <= 10 )
    ) D1
    order by c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15
    Thanks,
    Imtiaz

  • Compile forms error because using rank function

    Hi,
    Oracle Form 9i don't known rank function in my SQL statement. When compile forms, it alerts err message: "Encountered the symbol "(" when expecting one ..."
    code:
    select * from (
    select group_id, acct_no, acct_desc, rank() over(order by acct_no desc) rank_no from customer
    where group_id='002'
    ) where rank_no< 10000
    Help me ASAP.
    Many thank,
    Bum.

    Where is INTO clause ? Plz provide the actual code you are writing.
    I think this type of queries not supported in Forms 9i.....try forms 10g or above.

  • Rank function without filter in the report

    Hi,
    I have a problem with Rank() function. The problem is the next one.
    I have a table with this rows:
    User | DATE | Cost
    user1 | 12/02/2011 | 10,4
    user1 | 13/02/2011 | 11,1
    user1 | 13/02/2011 | 10,1
    user1 | 13/02/2011 | 8,1
    user2 | 12/02/2011 | 1,4
    user2 | 13/02/2011 | 12,1
    user2 | 13/02/2011 | 22,1
    user2 | 13/02/2011 | 8,1
    In the rpd I have a agregate row as SUM(COST), and I need extract te ranking of this SUM(COST) per user, The sum of user1 is 39,7 and the sum of the user 2 is 43,7. If I show in the report all users, the ranking is correct Rank=1 per user2 and Rank=2 per user1, but the problem is that I only want show the user1, when I add a filter to the report user='user1' the ranking value changes from 2 to 1. I need that the ranking value doesn´t change when I introduce a filter.
    Any idea about how to solve this problem?
    Thanks

    Hi Antonio,
    On the Rank column in the answers edit the formula as given below.
    Case when username = 'user2' then Rank(sum(cost)) else 0 end
    Then apply a filter on the Rank column as Rank > 0.
    I hope this one helps you.
    Regards
    AP

  • Rank function

    how to use the RANK function in oracle data integrator??

    Hi,
    a little google could help you..
    https://forums.oracle.com/thread/2158588
    Let us know

  • Rank Function taking a long time to execute in SAP HANA

    Hi All,
    I have a couple of reports with rank function which is timing out/ or taking a really long time to execute, Is there any way to get the result in less time when rank functions are involved?
    the following is a sample of how the Query looks,
    SQL 1:
    select      a.column1,
                    b.column1,
                    rank () over(partition by a.column1 order by sum(b.column2) asc)
    from         "_SYS_BIC"."Analyticview1"         b
                    join          "Table1"            a
                      on          (a.column2 = b.column3)
    group by  a.column1,
    b.column1;
    SQL 2:
    select    a.column1,
                    b.column1,
                    rank () over( order by min(b.column1) asc) WJXBFS1
    from         "_SYS_BIC"."Analytic view2"         b
                    cross join                "Table 2"               a
    where      (a.column2  like '%a%'
    and b.column1  between 100 and 200)
    group by  a.column1,
                    b.column1
    when I visualize the execution plan,the rank function is the one taking up a longer time frame. so I executed the same SQL without the rank() or partition or order by(only with Sum() in SQL1 and Min() in SQL 2) even that took a around an hour to get the result.
    1.Does anyone have an any idea to make these queries to execute faster?
    2. Does the latency have anything to do with the rank function or could it be size of the result set?
    3. is there any workaround to implement these rank function/partition inside the Analytic view itself? if yes, will this make it give the result faster?
    Thank you for your help!!
    -Gayathri

    Krishna,
    I tried both of them, Graphical and CE function,
    It is also taking a long time to execute
    Graphical view giving me the following error after 2 hr and 36 minutes
    Could not execute 'SELECT ORDER_ID,ITEM_ID,RANK from "_SYS_BIC"."EMMAPERF/ORDER_FACT_HANA_CV" group by ...' in 2:36:23.411 hours .
    SAP DBTech JDBC: [2048]: column store error: search table error:  [2620] executor: plan operation failed
    CE function - I aborted after 40 mins
    Do you know the syntax to declare local variable to use in CE function?

Maybe you are looking for

  • MacBook 2010 won't get past loading screen

    Hi everyone. I don't live anywhere near an apple store so am hoping I can get some help here. My MacBook won't get past the initial White loading screen with the grey apple logo. A loading bar (which I've never seen before) comes up, loads about 1/5

  • BA & cost center in asset posting

    HI all, i have 2 questions:- 1)  1 asset master - AA001, having BA as BA001 & CCTR as C001. then request to change as BA001 & C002. BUT C002 belongs to BA002. can we have this kind of setting other than changing the assignment of BA at cost center ma

  • Report borders setting

    HI, is there posibility to programmatically setup paper border before report printing. I still have problem with printing. This poblem sometimes happens but with printer HP bussines inkjet 1100 series it happens regularly. It happens this way: 1) Sta

  • Where to find the upgrade pricing and then download the latest photoshop elements?

    I have Photoshop Elements 9 and would like to upgrade to version 11 with the upgrade price. How do I do this, please? In the store page, I see only the full price.

  • Apple TV home sharing broken.. again.......

    I just updated Apple TV and iTunes because yet again home sharing wasn't working.  This has been a constant on again off again problem since I purchased my Apple TV over two years ago.  A new fix will come out and it will work, then a new update will