Selecting top N clients by branch or in the whole company

Hi all!
I have a report that selects the top 20 clients of each branch of the company. The company has more than 700 hundred branches. The report was done by:
1) creating a calculation using the rank function, partitioned by rank, ordered by descending total debt.
2) filtering the registers where rank <= 20.
In the report, the branch dimension is a page item.
What I need is that, when I select "ALL" in the page item (branch), the report brings the top 20 clients of the whole company. But, as the rank function calculates the rank for each branch, I have more than 700 clients ranked as 1, as 2, as 3 ,...
Is there a way of doing so, or do I have to create a new sheet just for a rank not partitioned by branch?
Thanks!
William

Hi all, again!
After a lot of consulting, I came across an almost satisfying workaround (without using LOV):
1) Create parameter "Scope" that can assume 2 values: "Branch" or "Country"; checking "Require user to enter value"checkbox.
2) Create calculation "Level of analysis":
case
when (:Scope = "Branch") then Branch.Code
when (:Scope = "Country") then "Brazil"
end
3) Put "Level of analysis" as page item.
4) Modify the rank formula to:
DENSE_RANK() OVER(PARTITION BY *"Level of analysis"* ORDER BY "Total Debt" DESC )
So, if the user wants the report at a branch level, he/she can input "Branch" in the "Scope" parameter. If he/she wants the report at a national level, he/she can input "Country" in the "Scope" parameter.
The only disadvantage is that each time the user wants to change the report from the branch level to the national level (or vice-versa), he/she will have to change the parameter value and rerun the query. In my case, it is very fast...
Thanks for all of those who have spent any time thinking about my situation.
William
Edited by: wlsuzuki on Sep 18, 2008 10:46 AM

Similar Messages

  • Client certificate authentication fails when the CA list sent by server is big and the list goes in 2 encrypted messages.

    I checked with IE browser(on windows and MAC) and MAC safari packet capture. The CA certificate list is sent by server in 2 messages as the list is too big. I compared packet by packet exchanges in both the browsers. It is same till TLSv1 handshake is done for the ldap certificate authentication. It works fine in IE without any issues though the certificate list is divided into 2 messages.
    In case of safari, after the TLSv1 handshake is done successfully, it again sends a SSLv3 'Client Hello' message and initiates the whole handshake process again and the server responds to it too till the handshake is complete. But it brakes after that with the server showing 'Cant establish secure connection' at the browser.
    The issue occurs only in case of MAC safari for big list of CA certs >150(where it crosses the max limit) from server. It is not clear why safari alone is switching from TLSv1 to SSLv3 in this scenario.
    NOTE: With shorter list of CA certs at server when it goes in one message, safari works fine and all messages are only TLSv1 and does not repeat the handshake process.
    I have checked on safari version 5 and 6.0.3 on OS X mountain lion.
    Is there any specific reason why MAC safari behaves like this or somethings needs to be done at server?
    Any help would be appreciated.

    I checked with IE browser(on windows and MAC) and MAC safari packet capture. The CA certificate list is sent by server in 2 messages as the list is too big. I compared packet by packet exchanges in both the browsers. It is same till TLSv1 handshake is done for the ldap certificate authentication. It works fine in IE without any issues though the certificate list is divided into 2 messages.
    In case of safari, after the TLSv1 handshake is done successfully, it again sends a SSLv3 'Client Hello' message and initiates the whole handshake process again and the server responds to it too till the handshake is complete. But it brakes after that with the server showing 'Cant establish secure connection' at the browser.
    The issue occurs only in case of MAC safari for big list of CA certs >150(where it crosses the max limit) from server. It is not clear why safari alone is switching from TLSv1 to SSLv3 in this scenario.
    NOTE: With shorter list of CA certs at server when it goes in one message, safari works fine and all messages are only TLSv1 and does not repeat the handshake process.
    I have checked on safari version 5 and 6.0.3 on OS X mountain lion.
    Is there any specific reason why MAC safari behaves like this or somethings needs to be done at server?
    Any help would be appreciated.

  • EPMA Batch client command Equivalent to Select Top Member

    Hi
    I am looking for EPMA batch client command equivalent to performing "Select Top Members" in web against a shared dimension in Application library.
    I can find commands for exclude members in the document but could not find any Dimension Property or Command which will help me to automate this.
    Thanks in Advance.
    Ram

    I don't believe there is a command that will do that yet.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • New NLE Build Specs I've Selected for My Client - Comments?

    OK, after mucho work, I've come up with what seems to be the best bang for the buck for my video conversion client who needs new systems.
    Here's what I selected:
    Antec DF-85 Black ATX Full Tower Computer Case (tons of space, USB 3.0 ports, CPU cooler cutout, 9 internal 3.5" drives, 7 fans, long video cards fit) - $156
    CORSAIR HX Series CMPSU-1000HX 1000W Power Supply  (any chance I need more than 1000W?) - $230
    ASUS P6X58D Premium LGA 1366 Intel X58 SATA 6Gb/s USB 3.0 ATX Intel Motherboard (Note: only available board supported by BlackMagic for their DeckLink/IntensityPro video capture cards, so this is pretty much it unless I want to chance a non-supported board with equivalent specs) - $290
    Intel Core i7-950 Bloomfield 3.06GHz 4 x 256KB L2 Cache 8MB L3 Cache LGA 1366 130W Quad-Core Processor BX80601950 (I intend to overclock to some degree, probably under 4GHz) - $270
    Prolimatech Armageddon CPU Cooler - Intel Socket LGA 775/1156/1366 Heatsink, 140mm Fan Compatible  (Selected this one because one Web site review of the ASUS board specifically used this cooler which fit nicely without covering up the 6 RAM slots; also this one gets good reviews everywhere) - $65
    XIGMATEK eXTREME SILENT Series XSF-F1452 140mm Case Fan x 2  (for the above cooler to improve cooling) - $20
    G.SKILL Ripjaws Series 24GB (6 x 4GB) 240-Pin DDR3 SDRAM DDR3 1333 (PC3 10666) Desktop Memory Model F3-10666CL9T2-24GBRL - $285
    Palit NE5X56T01142-1041F GeForce GTX 560 Ti (Fermi) 2GB 256-bit GDDR5 PCI Express 2.0 x16 HDCP Ready SLI Support Video Card  (lots of DDR5 RAM, 384 cores, 256-bit memory path, well reviewed) - $280
    SAMSUNG Spinpoint F4 HD322GJ/U 320GB 7200 RPM 16MB Cache SATA 3.0Gb/s 3.5" Internal Hard Drive -Bare Drive (for OS and programs) - $43
    SAMSUNG Spinpoint F3 HD103SJ 1TB 7200 RPM 32MB Cache SATA 3.0Gb/s 3.5" Internal Hard Drive -Bare Drive x 4 (for RAID 0) - $260
    SONY Black 12X BD-R 2X BD-RE 8X DVD+R 5X DVD-RAM 8X BD-ROM 8MB Cache SATA Internal Blu-ray Burner Blu-ray Burner BD-5300S-0B - OEM - $110
    Link Depot 39.37" SATA II Cable with Locking Latch Model LD-SATA-1 $4 X 5 Drives + DVD Burner - $24
    Total Cost:  $2033.00
    With Windows 7 Professional OEM and an Adobe Premiere Pro CS5 upgrade, that adds another $434 making a total of $2,467. I think the client can handle that. He will also probably get a Matrox MX02 Mini or a BlackMagic DeckLink/IntensityPro card to handle video capture. I'm leaving that decision up to his tech. If he needs to go to a full CS5 Production Suite, then he needs to tack on another $500-600 over the Premiere Pro upgrade price which will bring him up to $3,000 for the whole system.
    He needs to replace three machines in the video department, but my guess is we'll start with one, maybe two, and the productivity improvement over the crap he's using now may mean he doesn't need a third one. Considering he's upgrading from six-year-old+ Pentium 4 machines with 2GB RAM, no RAID, Adobe Premiere 1.5, these new systems should come as a shock. Hopefully the price for the upgrade won't be as big a shock.
    I welcome any comments on the system laid out above, positive or negative.
    I know I could improve this slightly with say, 10,000 RPM Velociraptors for the OS drive, and stuff like that, but I've tried to keep this pretty vanilla to hold the cost down.
    Let me know what you guys think.

    On the other hand, I just found this Tom's Hardware memory benchmark article which shows the difference between various RAM speeds and timings while doing video editing with Adobe Premiere CS4. The differences are minimal at best maybe 2-3 percent.
    http://www.tomshardware.com/reviews/memory-scaling-i7,2325-10.html
    It's not clear to me that the difference is worth either the difference in cost or more importantly how much work it might take to get a stable system.
    In the last half hour I've looked up a LOT of Web postings about the ASUS P6X58D Premium and 1600 memory. It's all over the place as to whether the issues people have had are with the RAM, the CPU memory controller, or their memory settings. I don't want to go through a couple weeks of RMAing memory back and forth to get it right. I need to have this machine up within the next 6 weeks and the client isn't going to be able to order for another two weeks.
    For one thing, if I decide to go with the 970, I'll have less need to overclock. I was not intending to overclock the 950 that high anyway, and if I go to the 970, I can overclock even less. So whether the RAM can be speeded up may not matter as much.
    I definitely won't buy multiple sets like you did, I've heard too many warnings about that not being guaranteed by the vendors.
    I also just found this Adobe Hardware Forum post which addresses this issue:
    http://forums.adobe.com/thread/695662?tstart=60
    I quote Mr. Bowen:
    Quote
    When  the I7 platform released, Intel's official supported specs were really  low. They only officially supported DDR3 1333 and that was with 3 sticks  of ram only. If you had 6 sticks then the supported clock speed of the  ram was 1066. Intel also only supported a QPI of 4.8 on most cpu's  accept for the top 1 or 2 which had a QPI support of 6.4. The  Motherboard manufacturers decided to go well beyond those specs because  they were way to conservative and to push their products. The  manufacturers like ASUS supported DDR3 1600 or even DDR2000 but only in 3  stick configurations. If you had any problems with 6 stick  configurations at DDR3 1600 or higher, they would respond they only  supported specs greater than Intel's with 3 stick configurations( I was  surprised they hid behind that back then when I talked to the engineers  of one of the companies). This does not mean that it will not work. It  just means you wont get support from the motherboard manufacturer if you  have problems. It really was a joke. So much so one of the companies I  can't name here changed their website to reflect that just because I  brought the subject up and told them this policy was no where on their  website at all when we tested their board.
    So  what does this all mean. The QVL is the Qualified Vendor List. This is  the hardware officially tested by the motherboard manufacturer's R&D  or tech support. This hardware is approved to work without issues and  will be fully supported by their tech support. The caveat is though only  in the officially supported configuration. Normally as long as you buy  ram off the QVL list, you can run those in 6 stick configurations and  you likely wont have problems as long as you set the bios up right. If  you buy ram that is not listed on the QVL now days with DDR3 then it's a  gamble on whether it will work or not without issues unless you have  some company like us that tests all of this and works with the Ram  company's engineering to fix any problems. So the best advice here for  DYI is stick to the QVL but remember you are not locked into the  official supported config. That is way to conservative. I hope that  helps.
    End Quote
    It's that "as long as you set the bios right" bit that concerns me. I don't want to spend two days tweaking the RAM settings as well as the CPU overclock considering the performance gain is likely to be less than 5%.
    Further comments on this?

  • SELECT TOP 1 .... ORDER BY

    Hi,
    I have the following statement in SQL SERVER:
    SELECT TOP 1 NAME FROM STUDENT ORDER BYGRADE
    Now, I am trying to translate it ti ORACLE PLSQL, I came up with this statement:
    SELECT NAME FROM STUDENT WHERE ROWNUM=1 ORDER BY GRADE
    It doesn't work. I guess ORACLE generates ROWNUM before the ORDER BY operation...
    How can I have SELECT TOP N ... ORDER BY ... in Oracle the way that I have it in SQL server?
    Any help would be apprecited,
    Alan

    Can you cut and paste exactly what you're doing in a SQL*Plus session? It seems to work for me
    SCOTT @ hp92 Local> create table t as select * from all_objects;
    Table created.
    Elapsed: 00:00:08.40
    SCOTT @ hp92 Local> desc t;
    Name                                                  Null?    Type
    OWNER                                                 NOT NULL VARCHAR2(30)
    OBJECT_NAME                                           NOT NULL VARCHAR2(30)
    SUBOBJECT_NAME                                                 VARCHAR2(30)
    OBJECT_ID                                             NOT NULL NUMBER
    DATA_OBJECT_ID                                                 NUMBER
    OBJECT_TYPE                                                    VARCHAR2(18)
    CREATED                                               NOT NULL DATE
    LAST_DDL_TIME                                         NOT NULL DATE
    TIMESTAMP                                                      VARCHAR2(19)
    STATUS                                                         VARCHAR2(7)
    TEMPORARY                                                      VARCHAR2(1)
    GENERATED                                                      VARCHAR2(1)
    SECONDARY                                                      VARCHAR2(1)
    SCOTT @ hp92 Local> create index idx_t on t( object_id );
    Index created.
    Elapsed: 00:00:00.78
    SCOTT @ hp92 Local> analyze table t compute statistics for all indexed columns;
    Table analyzed.
    Elapsed: 00:00:00.53
    SCOTT @ hp92 Local> set autotrace on;
    SCOTT @ hp92 Local> select *
      2    from (select * from t order by object_id)
      3   where rownum < 2;
    OWNER                          OBJECT_NAME                    SUBOBJECT_NAME
    OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE        CREATED   LAST_DDL_ TIMESTAMP           STATUS  T G S
    SYS                            DUAL
           222            222 TABLE              12-MAY-02 12-MAY-02 2002-05-12:16:20:50 VALID   N N N
    Elapsed: 00:00:00.13
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE
       1    0   COUNT (STOPKEY)
       2    1     VIEW
       3    2       TABLE ACCESS (BY INDEX ROWID) OF 'T'
       4    3         INDEX (FULL SCAN) OF 'IDX_T' (NON-UNIQUE)
    Statistics
              0  recursive calls
              0  db block gets
              3  consistent gets
              1  physical reads
              0  redo size
           1142  bytes sent via SQL*Net to client
            511  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processedJustin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Top 10 clients

    Hi ,
    I have a report with top 10 clients, but it is displaying only top 7 clients even though enough data is available.
    Can anyone suggest on this
    Regards,
    Vengatesh.

    Hi
    The query is as below:
    SELECT "Client Attributes"."Client Group" saw_0, "Financial Transactions"."Period Actual Balance" saw_1, Rank("Financial Transactions"."Period Actual Balance") saw_2, Time."XTD Period Name" saw_3, "Project Attributes".Tower saw_4, Account."Group Name" saw_5 FROM "Financial MIS" WHERE (Time."XTD Period Name" = 'MTD Feb-10') AND ("Project Attributes".Tower IN ('APPS', 'BPO', 'ITO')) AND (Account."Group Name" = 'Seats') AND (Rank("Financial Transactions"."Period Actual Balance") <= 10) AND ("Client Attributes"."Client Group" IS NOT NULL) ORDER BY saw_2
    please suggest

  • How can I delete apps from the app store? There seems to be every app I have ever downloaded and deleted since I got my phone in 2007. When I go to app store and select update apps there's a menu at the top that says purchased! I would like to delete hist

    How can I delete apps from the app store? There seems to be every app I have ever downloaded and deleted since I got my phone in 2007. When I go to app store and select update apps there's a menu at the top that says purchased and when I select it it shows every app I've ever had! I would like to delete the history please.
    Many thanks

    You cannot.
    The entire point of this is that you can redownload any and all of your past purchases.

  • Selecting (and resizing, for example) a layer under the top layer via the Program Monitor

    Hello all.
    Using CS5
    I am in the timeline and have selected layer 1 which is a video layer
    Layer 2 is a title layer.
    I want to manually resize layer 1, via the Program Monitor.
    But when I go to the Program Monitor and select it Layer 2 (the title layer) becomes selected, preventing me from selecting and manually resizing/repositioning Layer 1.
    The above example is a simplified version of what I usually find myself doing.  Usually I have many layers above a layer that I want to resize or reposition (or do something else) but when I try to resize or repositon via the program monitor I am only able to manipulate the top layer.
    Any suggestions, other than locking every layer other than what I want to resize etc .?
    Thanks
    Rowby

    Hi Bill,
    No they are separate orginal tracks. 
    Is there a way to "select" a layer below the top layer via the Progam Monitor -- and perform modifications on that lower level -- such a manually resizing on the Program Monitor.  I find if I want to do it via the Program  Monitor I have to temporarily lock the top layer.
    And if I have lots of layers above the layer I want to manually resize, I have to lock all of the layers above that layer so I don't start moving around (for example a title layer which might be the top layer of the sequence) in order to manually resize via the Program Monitor.
    I know (for example) in the case of scaling or repositioning a layer I could do it via the effects control panel, but I often want to do it via the Program Monitor.
    Rowby

  • How to select top one in CDS view ?

    I have tried following logic to select top one in CDS view but its giving error -
    define view Cds_View_First_Reference as select  top one CReferredObject from CDSVIEWCROSSREF

    Hi Ruchi,
    since you posted this question in "ABAP in Eclipse" I assume you are asking about CDS in ABAP. This is important because the CDS features sets in ABAP and (native) HANA are different.
    Be that as it may,, SELECT TOP 1 is neither supported in the CDS implementation in ABAP nor in HANA.
    In ABAP you might consider using the min() or max() function together with the appropriate GROUP BY clause in the CDS view (depending on what you want to achieve), but you can also easily "implement" this in the Open SQL statement which selects from your CDS view.
    Using the additions SELECT SINGLE or UP TO 1 ROWS and an appropriate ORDER BY clause in Open SQL, you can achieve the same as SELECT TOP 1.
    Unfortunately there is currently no possibility to define a view which delivers the TOP 1 which you can again use in another view ("view on view").
    Kind regards
    Chris

  • Prepared Statement, executing  SELECT TOP in Ms Access

    I'm having the following problem. I built an application fetching data without any problem from MS SQL Server, this was using prepared statements. Now i'm having this strange problem with the following query:
    SELECT TOP 1 *
    FROM table
    WHERE appliance_id = ?
    AND ttimestamp_initpk <= ?
    AND ((Type = ?) OR (Type = ?) OR (Type = ?) OR (Type = ?) OR (Type = ?) OR (Type = ?))
    ORDER BY ttimestamp_initpk DESC
    While on SQL Server this fetches just a record, on MS Access it fetches the whole set of records without worrying about TOP instruction.
    That is, it acts like a SELECT * FROM, and this slows down runtime behaviour.
    I'm using sun.jdbc.odbc.JdbcOdbcDriver, is it the problem?
    Thanks, Mirko

    Thanks for your answer, but i'm not sure this is the reason.
    I made one more test: i wrote a .Net application connecting to a MS Access using an ODBC connection. SELECT TOP statement is working fine, so i think i'll try another JDBC driver. Any other solution??
    Thanks,
    Mirko

  • ALTERNATIVE FOR 'SELECT TOP STATEMENT

    HI FRIENDS
    IF ANY ONE KNOWS HOW TO CONVERT THE SQL STATEMENT GIVEN BELOW PLEASE HELP ME
    SELECT TOP 1 CardID FROM EasyRechargeMaster WHERE CardGroup = EasyRecharge.CardGroup
    THANKS & REGARDS

    Check this query. It should give you desired results....Are you sure about that? Does TOP 1 mean "whatever happens to be the first row fetched"?

  • SELECT TOP query in HANA

       Hi,
    Can somebody give me the HANA equivalent of the following SQL query:
    SELECT TOP (731-624+1) COLUMNNAME FROM TABLENAME
    In case of HANA, it gives syntax error near "(".

    Hi Yash,
    As per the HANA SQL syntax supported case is
    <select_clause> ::= SELECT [TOP <unsigned_integer>] [ ALL | DISTINCT ]
    <select_list>
    After Top only an unsigned intger is expected and cannot handle an <expression> like in your example.
    Hope this is useful.
    Best Regards,
    Ranjit

  • Looking for the oracle equivalent of T-SQL 'SELECT TOP n'

    Hi,
    I'm looking for the Oracle equivalent of T-SQL 'SELECT TOP n'
    and can't find any. There is SAMPLE(n) function but it supposed
    to pick up random values and I'm not sure if it's possible to
    make it select top values. Please help 8-)
    Thanx

    Hi Marina.
    Oracle does not have a functionality like SQL Server for TOP
    selection. The ROWNUM option should be used with great care and
    you may get unreliable results.
    Try looking at Metalink
    Doc ID: 291065.999
    Doc ID: 267329.999
    - They discuss this issue, and solutions.

  • Group By Select Top 1 Rows

    Hi Guys,
    I tried Group By from Select Top 1 Records,  As below the script wasn't work.
    Please help.
    SELECT TOP 1 NR.SHGId, NR.Amount
    FROM NEW_DCB_REPORT NR
    WHERE NR.SHGId = ND.SHGId
    AND NR.ShgMemberId = ND.ShgMemberId 
    AND NR.LoanNumber = ND.LoanNumber 
    GROUP BY NR.SHGId,NR.Amount
    ORDER BY NR.LedgerNumber DESC
    SHGId
    SHGMemberId
    LoanNumber
    Amount
    Select Top 1 Row
    1028
    147852
    1
    1000
    Select Top 1 Row
    1028
    147853
    1
    2000
    Select Top 1 Row
    1028
    147854
    1
    1000
    Select Top 1 Row
    1028
    147855
    1
    1000
    5000
    I expected the results are:
    SHGId
    Amount
    1028
    5000

    Yes I did it.
    Select  SHGId,
    SUM(Amount)
    amt  FROM
    SELECT  NR.SHGId,
    NR.Amount,
    , Row_number()
    Over(partition
    by NR.SHGId,
    NR.ShgMemberId , NR.LoanNumber
    Order
    by NR.LedgerNumber
    DESC
    ) rn
    FROM NEW_DCB_REPORT NR
    JOIN
     NEW_DCB_REPORT ND
    ON
    NR.SHGId
    =
    ND.SHGId
    AND NR.ShgMemberId
    = ND.ShgMemberId
    AND NR.LoanNumber
    = ND.LoanNumber
    ) t
    Where rn=1
    GROUP
    BY  SHGId
    I just changed above the script Partition by add one more column and
    [yourNDTable]
    Should come NEW_DCB_REPORT table.
    However, It shows below the error ,. Please help.
    Invalid object name 'NEW_DCB_REPORT'.

  • Select top 10 in pivot special...

    How can I get the top 10 customers in the selected period. Group only customer.
    Then use these 10 customers and list them in each month, regardless what value they have on each month. The total value in the hole period should decide that. Group Year_Month and Customer. Show each customer in a separate field. Order by the biggest customer first. I'm stucked... Alex has help me so far with this, but this is not 100% right.
    Select sales, year_month, customer From
    Select sales, year_month, customer, rank() over (Partition by year_month Order by sales Desc) Rang
    From (Select Sum(SalesQty) As sales, customer, year_month From CustTable Where year_month Between 200709 And 200801 Group by customer, year_month) tempa
    ) tempb
    Where Rang <=10 Order by year_month, sales Desc;It should return something like this:
    YEAR_MONTH                        Statiol                             Mc Donalds 
    200709                                 90443062,9                             86446636,4
    200710                               103277956,29                           100488081,38
    200711                                 95907009,9                             39525297,2
    200712                                93945336,26                            58435507,81
    200801                                85986272,49                            29581584,28

    Sorry, I overlooked "top 10 customers in the selected period. Group only customer" which tells me you need to rank sales for the whole period. If so, use:
    SELECT  year_month,
            SUM(
                CASE CustomerTotalSalesRank
                  WHEN 1
                    THEN
                      SalesQty
                    ELSE
                      NULL;
                END
               ) customer_1,
            SUM(
                CASE CustomerTotalSalesRank
                  WHEN 2
                    THEN
                      SalesQty
                    ELSE
                      NULL;
                END
               ) customer_2,
            SUM(
                CASE CustomerTotalSalesRank
                  WHEN 3
                    THEN
                      SalesQty
                    ELSE
                      NULL;
                END
               ) customer_3,
            SUM(
                CASE CustomerTotalSalesRank
                  WHEN 4
                    THEN
                      SalesQty
                    ELSE
                      NULL;
                END
               ) customer_4,
            SUM(
                CASE CustomerTotalSalesRank
                  WHEN 5
                    THEN
                      SalesQty
                    ELSE
                      NULL;
                END
               ) customer_5,
            SUM(
                CASE CustomerTotalSalesRank
                  WHEN 6
                    THEN
                      SalesQty
                    ELSE
                      NULL;
                END
               ) customer_6,
            SUM(
                CASE CustomerTotalSalesRank
                  WHEN 7
                    THEN
                      SalesQty
                    ELSE
                      NULL;
                END
               ) customer_7,
            SUM(
                CASE CustomerTotalSalesRank
                  WHEN 8
                    THEN
                      SalesQty
                    ELSE
                      NULL;
                END
               ) customer_8,
            SUM(
                CASE CustomerTotalSalesRank
                  WHEN 9
                    THEN
                      SalesQty
                    ELSE
                      NULL;
                END
               ) customer_8,
            SUM(
                CASE CustomerTotalSalesRank
                  WHEN 10
                    THEN
                      SalesQty
                    ELSE
                      NULL;
                END
               ) customer_10
      FROM  (
             SELECT  year_month,
                     SalesQty,
                     ROW_NUMBER() OVER(PARTITION BY customer ORDER BY CustomerTotalSales DESC) CustomerTotalSalesRank
               FROM  (
                      SELECT  customer,
                              year_month,
                              SalesQty,
                              SUM(SalesQty) OVER(PARTITION BY customer) CustomerTotalSales
                        FROM  CustTable
                        WHERE year_month BETWEEN 200709 AND 200801
      WHERE CustomerTotalSalesRank <= 10
      GROUP BY year_month
    /SY.

Maybe you are looking for

  • Video card question.

    Hi, I just bought a new macbook pro. I got the cheapest one; http://store.apple.com/us/browse/home/shopmac/family/macbookpro?mco=MTM3NjU5MzU Now that I have a computer that isn't from the start of this decade I'm looking for one of those new games to

  • Default Internet Connect at startup?

    This is probably a ridiculously simple issue, butI recently installed 10.4.5 on my G4 Titanium laptop. Since that installation, my airport connection to my home wireless network no longer connects automatically at startup. I must select it every time

  • How do I transfer my data from my old LOST BlackBerry to my new one?

    Hi everyone, I hope someone could help me out... I recently lost my blackberry pearl 8100 after car accident ( & thankfully I backed up my data the week before); anyways now I wanted to know how I can transfer my data to my new blackberry curve? (wit

  • Itunes Dosn't Open After Upgrading to latest version

    Itunes was working correctly before this incident occurred. The Itunes update seemed to install fine, but when i got to intsalling Quicktime problems arose. I received an error code : -3 message and around the same time i received "quicktime.msi can'

  • Iphone frozen after trying to update

    i have tried to update my iphone but it is now frozen on the apple screen, wont turn off either