Reporting-Top 10 and Rank() function

Need to modify Top 10 Opportunities Pre-defined analysis report. In doing so, we loose the drop down Fiscal Qtr/Year. The only option is to create a Pivot table, and use Fiscal Qtr/Year as a selector. The issue is that I need to be able to retrieve the Top 10 for every Quarter/Year. What is happening now is that the report is pulling Top 10 Opportunities for the entire report, and when we select the Fiscal Quarter/Year, if a Top 10 Opportunities exists, it will return a record(s). If not, it returns 0. Need Top 10 for every quarter.
The Rank function is used. How do I achieve this using this functionality?
Thank you.

Hi,
Following information might be helpful in resolving the issue.
General Syntax of Ranking :
Rank( measure; (dimensions); [Top|Bottom])
Here is the work flow with an example :- (use efashion universe )
1) Create a webi report selecting objects quarter, year, sales revenue and create a cross tab
2) While creating a cross tab, use the Object Year in columns and object Quarter for rows.
3)Define a variable Var1 = Rank ([Sales Revenue] ; [Quarter]; [Year]) ForEach ([Year])
4) Insert a blank column next to year in the cross tab.
5) Drag and drop the variable Var1 in the new blank column inserted next to Object Year..
You will now find that you have ranking for the years 2001, 2002, 2003 being reflected
independently.
Regards,
Sarbhjeet Kaur

Similar Messages

  • Cummulative total and rank function

    Hi,
    I'm using Discoverer 3.1.36 and wondering if there is a way to
    get cumulative totals with Discoverer and how
    For i.e
    column A      column B      column C
         AB          50          50
         BC          100          150
         MB          70          220
    Also how to create the report that will show only top X values
    and has rank column too
    For i.e
    Rank     Column A
    1 50
    2 30
    3 15

    try importing your own sql statement for using the rank
    function. you may have to export sql first (to create the sql
    file), then edit it and import it.
    to get rank, you can try something like this:
    SELECT "User Name", "Number of whtvr"
    FROM
    (SELECT t1.username "User Name", COUNT(*) "Number of whtvr",
    RANK() OVER (ORDER BY COUNT(*) DESC nulls last) rank
    FROM table1 t1, table2 t2
    WHERE t1.userid=t2.userid
    AND t1.date BETWEEN t2.start_date AND t2.end_date
    GROUP BY t1.username)
    WHERE rank <= 10
    ORDER BY "Number of whtvr" DESC;
    try adding another column to assign a number to each row for the
    rank, maybe a sequence generated number, if a rank column (from
    the subquery) doesn't work.

  • Reports 6i and analytical function

    hi
    I have this query which wrks fine in TOAD
    SELECT rvt.receipt_num srv_no, rvt.supplier supplier,
                    rvt.transaction_date srv_date, inv.segment1 item_no,
                    rvt.item_desc item_description, hrov.NAME,               
                    (   SUBSTR (v.standard_industry_class, 1, 1)
                     || '-'
                     || po_headers.segment1
                     || '-'
                     || TO_CHAR (po_headers.creation_date, 'RRRR')
                    ) po_no,
                    po_headers.creation_date_disp po_date,   
                          (  (rvt.currency_conversion_rate * po_lines.unit_price)
                     * rvt.transact_qty
                    )aMOUNT  ,
    ----Analytic function used here                      
            SUM(          (  (rvt.currency_conversion_rate * po_lines.unit_price)
                     * rvt.transact_qty)) over(partition by hrov.NAME) SUM_AMOUNT,                                                                                 
                    (SELECT SUM (mot.on_hand)
                       FROM mtl_onhand_total_mwb_v mot
                      WHERE inv.inventory_item_id = mot.inventory_item_id
                        --  AND INV.ORGANIZATION_ID=MOT.ORGANIZATION_ID
                        AND loc.inventory_location_id = mot.locator_id
                        AND loc.organization_id = mot.organization_id
                        AND rvt.locator_id = mot.locator_id) onhand
               FROM rcv_vrc_txs_v rvt,
                    mtl_system_items_b inv,
                    mtl_item_locations loc,
                    hr_organization_units_v hrov,
                    po_headers_v po_headers,
                    ap_vendors_v v,
                    po_lines_v po_lines
              WHERE inv.inventory_item_id(+) = rvt.item_id
                AND po_headers.vendor_id = v.vendor_id
                AND rvt.po_line_id = po_lines.po_line_id
                AND rvt.po_header_id = po_lines.po_header_id
                AND rvt.po_header_id = po_headers.po_header_id
                AND rvt.supplier_id = v.vendor_id
                AND inv.organization_id = hrov.organization_id
                AND rvt.transaction_type = 'DELIVER'
                AND rvt.inspection_status_code <> 'REJECTED'
                AND rvt.organization_id = inv.organization_id(+)
                AND to_char(to_date(rvt.transaction_date, 'DD/MM/YYYY'), 'DD-MON-YYYY') BETWEEN (:p_from_date)
                                                     AND NVL (:p_to_date,
                                                              :p_from_date
                AND rvt.locator_id = loc.physical_location_id(+)
                AND transaction_id NOT IN (
                       SELECT parent_transaction_id
                         FROM rcv_vrc_txs_v rvtd
                        WHERE rvt.item_id = rvtd.item_id
                          AND rvtd.transaction_type IN
                                      ('RETURN TO RECEIVING', 'RETURN TO VENDOR'))
                                      GROUP BY rvt.receipt_num , rvt.supplier ,
                    rvt.transaction_date , inv.segment1 ,
                    rvt.item_desc , hrov.NAME,v.standard_industry_clasS,po_headers.segment1,po_headers.creation_datE,
                    po_headers.creation_date_disp,inv.inventory_item_iD,loc.inventory_location_id,loc.organization_id,
                    rvt.locator_iD,rvt.currency_conversion_rate,po_lines.unit_price, rvt.transact_qty
    but it gives blank page in reports 6i
    could it be that reports 6i donot support analytical functionskindly guide another alternaive
    thanking in advance
    Edited by: makdutakdu on Mar 25, 2012 2:22 PM

    hi
    will the view be like
    create view S_Amount as SELECT rvt.receipt_num srv_no, rvt.supplier supplier,
                    rvt.transaction_date srv_date, inv.segment1 item_no,
                    rvt.item_desc item_description, hrov.NAME,               
                    (   SUBSTR (v.standard_industry_class, 1, 1)
                     || '-'
                     || po_headers.segment1
                     || '-'
                     || TO_CHAR (po_headers.creation_date, 'RRRR')
                    ) po_no,
                    po_headers.creation_date_disp po_date,   
                          (  (rvt.currency_conversion_rate * po_lines.unit_price)
                     * rvt.transact_qty
                    )aMOUNT  ,
    ----Analytic function used here                      
            SUM(          (  (rvt.currency_conversion_rate * po_lines.unit_price)
                     * rvt.transact_qty)) over(partition by hrov.NAME) SUM_AMOUNT,                                                                                 
                    (SELECT SUM (mot.on_hand)
                       FROM mtl_onhand_total_mwb_v mot
                      WHERE inv.inventory_item_id = mot.inventory_item_id
                        --  AND INV.ORGANIZATION_ID=MOT.ORGANIZATION_ID
                        AND loc.inventory_location_id = mot.locator_id
                        AND loc.organization_id = mot.organization_id
                        AND rvt.locator_id = mot.locator_id) onhand
               FROM rcv_vrc_txs_v rvt,
                    mtl_system_items_b inv,
                    mtl_item_locations loc,
                    hr_organization_units_v hrov,
                    po_headers_v po_headers,
                    ap_vendors_v v,
                    po_lines_v po_lines
              WHERE inv.inventory_item_id(+) = rvt.item_id
                AND po_headers.vendor_id = v.vendor_id
                AND rvt.po_line_id = po_lines.po_line_id
                AND rvt.po_header_id = po_lines.po_header_id
                AND rvt.po_header_id = po_headers.po_header_id
                AND rvt.supplier_id = v.vendor_id
                AND inv.organization_id = hrov.organization_id
                AND rvt.transaction_type = 'DELIVER'
                AND rvt.inspection_status_code <> 'REJECTED'
                AND rvt.organization_id = inv.organization_id(+)
                           AND rvt.locator_id = loc.physical_location_id(+)
                AND transaction_id NOT IN (
                       SELECT parent_transaction_id
                         FROM rcv_vrc_txs_v rvtd
                        WHERE rvt.item_id = rvtd.item_id
                          AND rvtd.transaction_type IN
                                      ('RETURN TO RECEIVING', 'RETURN TO VENDOR'))
                                      GROUP BY rvt.receipt_num , rvt.supplier ,
                    rvt.transaction_date , inv.segment1 ,
                    rvt.item_desc , hrov.NAME,v.standard_industry_clasS,po_headers.segment1,po_headers.creation_datE,
                    po_headers.creation_date_disp,inv.inventory_item_iD,loc.inventory_location_id,loc.organization_id,
                    rvt.locator_iD,rvt.currency_conversion_rate,po_lines.unit_price, rvt.transact_qtyis this correct ? i mean i have not included the bind parameters in the view ..moreover shoud this view be joined with all the columns in the from clause of the original query?
    kindly guide
    thanking in advance

  • Sorting records in Sort and Rank report

    I created a Top 10 report based on the Sort and Rank template. The report behaves well at first, giving me 10 records nicely sorted. However, after having run it a few times with various parameters, the sorting seems to be random.
    The EVENE() in cell I33 refers to the row set in cell F5:
    TopCount(Descendants([ENTITY].[RepEntities], 99, LEAVES),10,([ENTITY].CurrentMember,[TIME].[2009.JAN],[RCFINANCE].[31_RC],[CATEGORY].[ACTUAL],[RPTCURRENCY].[LC],[COUNTERPART].[ALL_Counterpart],[MEASURES].[YTD],[DATASRC].[LegalTotal],[ORGANIZATION].[ALL_Organization],[FLOWDETAIL].[All_F]))
    In cell F6, there is an Order expression:
    Order(Descendants([ENTITY].[RepEntities], 99, LEAVES),([ENTITY].CurrentMember,[TIME].[2009.JAN],[RCFINANCE].[31_RC],[CATEGORY].[ACTUAL],[RPTCURRENCY].[LC],[COUNTERPART].[ALL_Counterpart],[MEASURES].[YTD],[DATASRC].[LegalTotal],[ORGANIZATION].[ALL_Organization],[FLOWDETAIL].[All_F]),BDESC)
    However, there seems to be no reference the this expression in EVENE() or elsewhere, which I guess is why the sorting doesn't work.
    Is anyone familiar with the Sort and Rank template and can tell me where to include this Order expression and the syntax for it? My version is 7.0M.
    Cheers,
    Cecilia

    Hi,
    The DB->set_bt_compare() is used to compare keys in Btree database. In the callback function, both the DBTs are key, but not data. Please refer to http://www.oracle.com/technology/documentation/berkeley-db/db/api_reference/C/dbset_bt_compare.html.
    If you want any field in the data to be sorted, you might create a secondary index on it and define the compare function as you wish.
    Regards,
    Emily Fu, Oracle Berkeley DB

  • Rank function on Union reports

    Hi All,
    I have a requirement where i have 2 reports the first report is a single and simple report where i have to show top 10 countries based on a measure value and it should have a section break on country which i have achieved the same using a rank function.
    Another report which has got 20 union reports but rank function is not working the same way as a single and simple report, i couldn't get any possible solution for this. Any pointers would be much appreciated
    Regards
    Pavan

    Hi srini,
    I did not get you, what exactly you mean keeping the rank in outer query? i have used rank function in each of the 20 union reports.

  • 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

  • Top-N Filter and Rank

    Hi,
    I want to display the Top-3 records based on the dashboard prompts and also display the overall rank of the record independent of the prompt.
    My data is in the format:
    Region Market Revenue
    East New York1 $100
    East New York2 $80
    East San Jose1 $50
    East San Jose2 $60
    North Det1 $125
    North Det2 $20
    North Dal1 $22
    North Dal2 $25
    Users will be selecting the Region, Market from Dashboard prompts and want to see the top-3 based on their selection and also see their rank nationally. So, If I selected East Region, my output should be
    Region Market Rev Rank
    East New York1 $100 2
    East New York2 $80 3
    East San Jose1 $50 5
    I defined a Top-3 filter and used Rank function but that gives the ranking as 1,2,3. This is expected as it is ranking the filtered set. I tried the Rank By function but that didn't help either.
    Any help would be appreciated.
    thanks,
    Prakash

    Build the "overall" ranking in the BMM layer and expose it as a separate column. Then add it to your Request. Now the rank will be independent of the filter.

  • Get rid of the white space at the top and bottom of the report when Printing as PDF document

    Hello All,
    I have a wider tablix report which is 29 inches wide. I have given the paper size as custom and width as 29 and height as 11 in report properties.I have deployed it and saved it as PDF document. When I print preview the report I am using the paper size as
    tabloid (17 by 11) and selected the orientation as Landscape. I am getting the full report without any stripping but I am getting some extra space at the top and bottom when I print the report. Can anyone help me how to get rid of this space? . I checked the
    margins for the report and it was 0in. Please help.
    Thank You

    Hi There
    In Reporting Services (SSRS 2008), there are white spaces preserved in the report body by default. When the white space extends the body size beyond the width of the report, blank pages will be generated. To avoid the issue, you can set the “ConsumeContainerWhiteSpace”
    property of the report to “True”.
    Please try to adjust your margins (top + side) and hopefully this problem will get resolved
    Body Width <= Page Width - (Left Margin + Right Margin)
    Horizontal usable area:
    X = Page.Width - (Left Margin + Right Margin + Column Spacing)
    Vertical usable area:
    Y = Page.Height - (Top Margin + Bottom Margin + Header Height + Footer Height)
    Body Width <= Page Width - (Left Margin + Right Margin)
    Horizontal usable area:
    X = Page.Width - (Left Margin + Right Margin + Column Spacing)
    Vertical usable area:
    Y = Page.Height - (Top Margin + Bottom Margin + Header Height + Footer Height)
    If you have any questions please ask.
    Many Thanks
    Syed Qazafi Anjum
    Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful.

  • Crystal Reports and SAP Function Modules

    Hi
    Am very new to Crystal Reports. Am developing a new report. my question is can I link a SAP FM on crystal and will it display the results on the FM on crystal.

    Hi,
    yes Crystal Reports can leverage ABAP Functions. You can find the details in the documentation for the SAP Integration Kit
    Ingo

  • TS3048 I have just purchased a new apple cordless keyboard.  The numeric line of keys along the top are not functioning as they should.  For example I am unable to get a question mark or a forward slash.  I have tried holding down both shift and alt keys.

    I have just purchased a new apple cordless keyboard.  The numeric line of keys along the top are not functioning as they should.  For example I am unable to get a question mark or a forward slash.  I have tried holding down both shift and alt keys.

    Thanks for prompt response - I tried what you suggested but I'm afraid it has not helped.  It seems as though the line of number keys along the top aren't actually doing what is printed on them.  Some are OK, but the further towards the right hand side of the keyboard you go, the less predicatable it becomes.  So whilst the second key from the left gives me 1 and ! when holding the shift key, by the time I get to the 6 when I press and hold shift I get ^ rather than & symbol which is what is actually printed on the key.  The & symbol is actually on the next key along - and when I hit the key with 8 I get * rather than the ( which is printed on they key but actually located on the next key along.  Things get even more muddled by the time I am over on the right hand side as rather than a question mark (I have had to type the word as I cannot find the symbol anywhere!) I get this _ and the other symbol marked on the key is a comma, but I get - instead.  It is going to drive me mad if every time I want to type something it is a guessing game....!  What do you suggest - question mark

  • To remove the spacing in top and bottom of XML report while printing

    Hi,
    I have developed the RTF template having page size(Page Setup->Page Size) as Custom Size(Width:19" and height:9.01").When I try to run the report thorugh the APPS,there is lot of spacing included at top and bottom of the page.This is mainly due to printer page size as A4.
    Due to the report layout,I cannot change to A4 which will make the report layout clumsy.
    Is there any kind of apps page setup to be done which will relate pagesize CUSTOM to A4.
    Please advise
    Regards,

    Hi
    Are you saying that once the document is printed ou get the space? If you run to PDF and view it with Reader then the paper size is correct?
    If so then you need to set up a prt file to specify the custom paper size. I suspect you are pushing it thru a regular A4 driver and its being resized for the paper.
    Writing print files is a little bit of an art form but check out the 'SysAdmin guide and the pasta guide for some further help.
    Regards
    Tim

  • I have acrobat pro on my lap top and recently installed acrobat pro on my Mac Mini, but the text recognition function is not working, does anyone have any advice on how to remedy this problem?

    I have acrobat pro on my lap top and recently installed acrobat pro on my Mac Mini, but the text recognition function is not working, does anyone have any advice on how to remedy this problem?

    On my laptop when I open up a pdf file and do a search for a particular
    text phrase it prompts me to run a character analysis.  Whereas on my mac
    mini, when I try to engage the same process it just says it couldn't find
    the phrase and doesn't even try and run a character analysis. I tried
    clicking on the tool bar and the recognize text tab but nothing there seems
    to do anything.
    In trying to figure out the issue on my own I noticed one thing.  I run a
    small law firm in St. Louis and I scan in all my files to which are
    subsequently emailed to my outlook account where I will save them as pdf's
    to their respective folders.  On my laptop when I open up an email from my
    scanner I see the image of a acrobat document next to the attachment
    paperclip symbol.  However, when I open up the same email on my mac mini I
    notice instead of an acrobat file image it shows a Preview file image (the
    program used to open up pdf's before I installed acrobat).
    Hope this helps!
    Sincerely,
    Jonathan McAllister

  • 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

  • TopN and Rank in OBIEE-Answer

    Hi All,
    I'm an "OBIEE newbie" and not sure how to use the Topn or Rank function to achieve the desired resullt below.
    I have a report that will display the top 10 or 20 (or whaterver # entered by users) of hospitals that have highest # of patients and then a sum of patients from the rest of other hospitals. ex:
    Hospitals #patients rank
    ABC 1500 1
    KLM 1200 2
    DEF 1200 2
    XYZ 200 10
    Other hospistals:      5000
    The top 10 or 20 # will be used as a prompt.
    Your help is much appreciated !!!
    Thanks,
    Ty

    Hi David,
    I did follow John's posting (it's very helpful for a beginner) but I just could not figure out what he did in Pivot table to get the SUM of the one that did not make the top 10 list. If you could show me how to do that :)
    Thank you for help!
    Ty

  • Rank function breaks drill down 11g

    I have a simple drill down report standard hierarchy and am having a weird issue with the rank function.
    This report works on 10g but the upgraded 11g version does not.
    When I drill down past the 2nd level it adds an is null filter to the revenue column.  This is also the column we are using to base our rank function.
    If I move the rank column to the first or last position in the table the drills work perfectly.  If I move it to the second column it breaks on the first drill instead of the 2nd.
    It works perfectly if drilling on the headings instead of the values.  That seems to point to some sort of null coming through when being passed.  I've tried using an ifnull and a case statement and neither method works, it just applies the is null filter to the entire column formula.
    The client doesn't want to change the position of the rank column so that work around will not do.  Any ideas?

    A similar thread was recently talked about here:
    In OBIEE charts, how do you make drill downs work on custom formulas?
    With a calculated column, you need to make sure the source query and destination query have the EXACT same formula and the same name for the field. If it is not 100% identical, it may not work correctly. (I typically use the NAVIGATE function to get to the second query rather than the Drill function.)
    Now in some cases, if you try to create a second drill down query with more details in it, the original formula doesn't work the way you want it to. The calculated formulas have to make sense in both source query and destination query in order to work properly. If you have a ranking of the Top 5 Products in the source query, the destination query also has to have the same ranking of Top 5 products in order to work. If you add more fields into the destination query (e.g., adding on product attributes, or # of records associated with that product name etc.), then sometimes the ranking / aggregation in the destination doesn't add up the same way. This causes the system to think that the formulas are different and prevents the drill down.
    I managed to get around this by having a 3rd query in between the original summary view and the detailed data view. So the sequence would be (for example):
    - Dashboard based summary query (including the calculated ranked product names formula)
    - drill down into virtually identical query (add on one slight bit of difference here, for example adding on a second Product Name field ... not a calculated version, but the actual name). Create a drill down this time by clicking on the regular Product Name field (don't drill down on the custom formula)
    - final detailed drill-down query
    You can format this intermediary drill down query to explain to users that they need to click a second time.
    It's not ideal, but it should work. Hope this helps.
    Ted

Maybe you are looking for

  • SQL Developer objects not showing DDL

    Greetings! First time posting here on the Oracle forums, so hopefully I can be as specific as possible :) I'm having an issue with displaying the SQL that makes up an object, specifically a VIEW. Here is the scenario: I log on as an IT user - WDSQUER

  • I start firefox and all my settings are gone. Why?

    Firefox reset all my settings. For example the toolbar layout.

  • Loading Batch from Bridge-Tools-Photoshop-Batch no screen appears

    Can't get Batch screen to load in cs6 from Bridge-Tools-Photoshop-Batch

  • Tunning the Query with Distinct Clause

    Hi All, I have the below query that returns 28113657 records select src_Wc_id, osp_id, src_osp_id from osp_complements o1 where exists (select 1 from wc_crossref wc                     where wc.src_wc_id = o1.SRC_WC_ID                     and wc.stat

  • Show Rows Where Two Columns have Same Data

    Hello, I have a spreadsheet that I need to sort by showing me all the rows where the data is equal between two columns. I.E. I have a column called Last Name and I have another column, U, with some of those Last Names, I want to sort the spreadsheet