Having Percentage on the Totals line instead of SUM

Hi,
I have a report with several number columns and several percentage columns. I need to show a totals line with grand totals for the number columns, and overall percentage for the percentage columns - how can I achieve this? I guess there is a more general question about showing any non-SUM summary function on the totals line, such as AVG, COUNT, MIN, MAX etc.
I could do it as a UNION I suppose but then I have the problem of formatting the totals line, and this wouldn't really work for break groups, only a grand total.
Any ideas?
Steve

You might want to look into the CUBE, ROLLUP and GROUPING SETS (OLAP) extensions to the GROUP BY clause in SQL. They generate intermediate subtotals, break totals, grand totals, etc using plain SQL.
Here is a quick example of what I mean
http://htmldb.oracle.com/pls/otn/f?p=24317:190
I have chosen to use SUM(SAL), AVG(COMM) and MAX(SAL) as the aggregates, you can modify this as per your requirements.
The query is
select
empno,ename,job,deptno,
sum(sal) sum_sal,
avg(comm) avg_comm,
max(sal) max_sal
from emp
group by rollup(empno,ename,job,deptno)
having  grouping_id(empno,ename,job,deptno) in (0,15)The GROUPING_ID gives a binary "bitmap" of which columns are showing a detail row vs. a aggregate/super-aggregate row. In this case, we want to show the lowest level of detail (0) and the highest grand total (15=binary 1111 or all bits turned on)
Again, you can tweak this to show intermediate subtotals, just take out that HAVING clause to see what you get and modify as needed.
Hope this helps.
Message was edited by:
Vikas

Similar Messages

  • How to count the total lines of the file (including the file header)

    Hi all,
    I am working with Idoc to file scenario(FCC).
    I need to map one of the field with a recound count ie.., count of the total lines of the file (including the file header).
    Eg:Record Count-- mapping area:Total number of records in the file including file header     The total line of the file (including the file header).
    Can i get a help on this.
    Thanks and Regards,
    Manoj

    Hi !
    If there is a tag of your IDOC that occurs the same quantity of times as file lines you have to create in your target file, you could make a Java user defined function in graphical mapping that "caches the entire queue" (use the corresponding option button), that receives as input that field of the IDOC, and returns the "lenght" (.length property value) of that input parameter (it is an array) as output..that should be the file line quantity..you may also add 1 to that count, for the header.
    Hope it helps.
    Regards,
    Matias.

  • How to count the total lines of code in Java project in NWDS

    Hi,
    I have created a simple web application in java using NWDS. For audit purposes, I need to know the total lines of java code in this project.
    We use Netweaver Development Studio (NWDS) to build & deploy the Java applications
    Is there any tool available in NWDS that cant do this job quickly ?
    Thanks in advance.
    Vikram

    Hi All,
    I have found out the solution to this problem.
    There is a SAP tool - Jlin thats available in NWDS.
    Further reference, see this
    http://help.sap.com/saphelp_nw04/helpdata/EN/f7/3d9d3c838436428a154abc3816fd9c/frameset.htm
    Cheers
    Vikram

  • LIS List Method average the total line

    In LIS standard analysis, is it possible to create a list method routine that will show the total line value as an average rather than sum?

    In LIS standard analysis, is it possible to create a list method routine that will show the total line value as an average rather than sum?

  • Merge the total line about header and item in the Hierarchical Seq ALV

    Hello guys,
    Now i used CL_SALV_HIERSEQ_TABLE to create a Hierarchical Sequential ALV. but there are two total lines, one is to calculate the numerical fields in the header(main) and another is calculate the numerical fields in the item(slave).
    my requirement doesn't contain the calculation for header line, so the first line is unuseful and i want to merge these two  line. 
    how i should do with it?
    Any clues is appreciated.
    Thanks a lot

    could anyone help me? i am very urgent!

  • How do I make it so a word will drop down to the next line instead of splitting in half with a (-) ex: awes-ome

    In Pages it is making words slit in half instead of dropping the whole word down onto the next line. How do I change it so that the whole word goes down?

    J,
    In the Document Inspector, Document tab, turn off Hyphenate.
    Jerry

  • When I open a new tab, how can I get the curson to be on the URL line instead of in a search engine box?

    When I open a new tab I almost always I know the URL of where I want to go. Therefore I do not want my cursor to be placed in the box of a search engine upon opening the new tab. I want it to be on the address line.

    A new tab opens by default as a blank tab (about:blank).
    If that isn't the case then an extension has changed that behavior.
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • How can I place multiple choice boxes on the same line instead of in a column?

    I know it is possible to place multiple fields on the same line, using drag and drop.
    But to save space, I would like to have 3 or 4 multiple choice boxes next to each other on one line. 
    Is this possible, and if so, how?
    Thanks
    Peter

    You may click on the "+" button to the right of the first multiple choice box to add more in the same line. When you hover over the button, the tooltip says "insert item beside".

  • TS2755 When I click on a  IPhone number in contacts to send a message.  It keeps trying to send the message to the land line.  I deleted the whole contact and re-entered it.  But, still wants to send to the land line instead of the IPhone.

    When I try to send messages to another IPhone.
    I go to contacts.
    Touch IPhone number.
    Type message.
    Hit send.
    Comes back to me.
    "Can not send messages to land line"
    Well I did not touch the land line number - I touched the IPhone number.
    I have deleted the whole contact, and re-entered it. 
    I have turned the IPhone off and on.
    Still I get this message on only two of my contacts.
    HELP

    I can't delete my question, so I'll just say that you press on the type of number written in the box to the left of the box you typye the number into.  Dumb or what? 

  • I have NDS 4.16, and I have iMS 5.1 running on Sun, Solaris 8. I want to know how can I add users using the command line instead of the console. My problem is how to set the password to this user?

     

    You can use ldapmodify found in <ServerRoot>/shared/bin
    for example
    ./ldapmodify -h ldaphost -D "cn=directory manager" -w password -f <name of LDIF file>
    Here's an example LDIF file
    dn: uid=cms,ou=people,o=balius.com,o=Universe
    changetype: add
    objectClass: person
    objectClass: organizationalPerson
    objectClass: inetOrgPerson
    objectClass: inetUser
    objectClass: ipUser
    objectClass: inetMailUser
    objectClass: inetLocalMailRecipient
    objectClass: nsManagedPerson
    objectClass: userPresenceProfile
    cn: Chad M. Stewart
    sn: Stewart
    initials: CMS
    givenName: Chad
    pabURI: ldap://host:389/ou=cms,ou=people,o=balius.com,o=Universe,o=pab
    mail: [email protected]
    mailDeliveryOption: mailbox
    mailHost: my.mailhost.com
    uid: cms
    dataSource: Chad by hand
    userPassword: users-password-here
    inetUserStatus: active
    mailUserStatus: active
    mailQuota: -1
    on a subsequent search you'd see something like
    userpassword: {SHA}S3e+L/K6

  • Change the total and subtotal dynamically in ALV GRID

    Hi guys,
               I need to change the total and subtotal of field "AMOUNT" dynamically.I am using ALV GRID CONTROL(oops concept).I need to override the standard functionality.I need to show my own subtotal and total line instead of standard one .

    Hi
    I've understood it, I wanted to use OO Grid too, but I had to use the ALV list in order to write my total.
    If you need to use OO grid u can try to exclude all funcitonalities for the total, subtotal and sorting and insert in the output table the lines with your totals.
    Max

  • Problem in the total of the Query

    Hi people.
    I have a Query where there is 3 itens for exemple with the same value.
    Document A=3Km   Document B=3Km   Document C=3Km   and the total i configurated to show the same value=3Km
    But when I take of the driw down where will show only one line, the query show the total 9Km instead of 3Km.
    The query lost the parameter I have put to show the same value.
    Do you know how I can do to show the same value=3Km when I have the query wothout driwdoun?
    Thanks.

    Hello,
    Just try if this works..In your Amount formula, click on Aggregation tab, select Exception aggregation as Maximum or Minum  and select Reference characteristic as the lowest level in your hierarchy.
    Thnaks.
    With regards,
    Anand Kumar

  • Pasting in JTextPane adds the text in the next line not the cursor positon

    Hi,
    I have a problem with pasting the text in a JTextPane. The content type is text/html and the document is HTMLDocument. When I paste the text, it goes to the next line instead of inserting at the current cursor position. The problem is when pasting, the html writer adds a paragraph tag with the selected text. Can any one please help me with this issue for pasting a selected text in the position where I want, without loosing the character attributes and other html tags, but only the paragaraph tags?
    Thanks
    siju

    Hi Tariq,
    If you are specifying some .prt files(printer definition files) in the desformat, please examine them if you have set the width and height to proper values.
    Otherwise look at $ORACLE_HOME/reports/printers/dflt.prt (default file) and see if the width and height are set to proper values.
    Thanks,
    Siva B

  • Total and non-total lines in ALV grid

    Hi all,
    Does anyone know if there is any standard SAP functionality for retrieving the non-total/raw item lines that lies beneath a total line in an ALV grid (after the user has selected the total line)?
    All helpful answers will be rewarded!
    Best regards,
    MV

    Try the ALV event AFTER-LINE-OUTPUT may be it can help u to achieve ur requirement.
    Append  AFTER-LINE-OUTPUT event to the internal table T_EVENT.
    CLEAR W_EVENT.
    W_EVENT-FORM = SLIS_EV_AFTER_LINE_OUTPUT.
    W_EVENT-NAME = SLIS_EV_AFTER_LINE_OUTPUT.u201CAFTER_LINE_OUTPUT event
    APPEND W_EVENT TO T_EVENT.
    FORM AFTER_LINE_OUTPUT
      USING P_RS_LINEINFO TYPE SLIS_LINEINFO.
    Here you have to write the logic to retrieve the 'total' line
    ENDFROM.
    Now call the alv FM
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
          I_CALLBACK_PROGRAM = L_REPID    "Program Name
          IS_LAYOUT          = W_LAYOUT   "Layout of the Report
          IT_FIELDCAT        = T_FIELDCAT "Field Catalog for Report
          IT_EVENTS          = T_EVENT    "For setting the events
       TABLES
          T_OUTTAB           = T_OUTPUT   "Report data Internal Table
       EXCEPTIONS
          PROGRAM_ERROR      = 1
          OTHERS             = 2.

  • Total line in ALV grid

    Hi,
    Can I use a total line in an ALV grid and hide part of the columns, so that only the total line will be presented for some of the columns ?

    Hi,
    Yes u can use a total column in the ALV Grid.
    Check the code below:
    AT LAST.
          WA_ALV_CAT1-FIELDNAME = 'TOTAL'(004).
          WA_ALV_CAT1-COL_POS = L_I.
          WA_ALV_CAT1-COLTEXT = 'TOTAL'(004).
          WA_ALV_CAT1-JUST =  C_CENTER.   " 'C'.
          APPEND WA_ALV_CAT1 TO L_ALV_CAT1_TAB.
          CLEAR  WA_ALV_CAT1.
        ENDAT.
    Regards
    Kannaiah

Maybe you are looking for