Sum Across Group

Hello!
I am running into a curious situation with Reports and I have been unsuccessful in trying to resolve it. Here is the description. I have a group (Job Category) that has a subgroup (Gender) which has a subgroup (Salary Range). I am running the report to all sorts of totals to the effect of something like this:
Job Category : Janitorial
MALES
10-20 K 0 0 15 20
20-30 K 0 10 0 5
FEMALES
10-20 K 10 5 0 0
20-30 K 5 10 0 10
My problem is that because of the way groups are laid out, I cannot sum together the totals of MALE and FEMALE within the same salary range. For example, say I wanted to total all employees who make 10-20K in the Janitorial job class the total I want is:
0 + 0 + 15 + 20 + 10 + 5 + 0 + 0 = 50
My results currently come out as:
0 + 0 + 15 + 20 = 35
10 + 5 + 0 + 0 = 15
They are separated by the group GENDER and I cannot sum these two together no matter what I seem to do. Any suggestions are welcome! Thank you!

I'm not sure there's a way of doing it easily using Reports, but there's always the option of obtaining these figures via additional queries. These could either be queries as seen in the data model editor or (often simpler) formula columns whose formulae consist of database lookups via pl/sql.
If you want these figures to come out for each salary range you may have a problem, since such formula columns would need to be placed into one of your groups and there doesn't seem to be an obvious place to put them with your existing group structure. If you put the salary range group above gender you could get it quite easily via a summary, but the question is whether this would allow the layout you're looking for? Probably not.
These extra queries will make the report slower, but sometimes there's no alternative.
HTH,
Mike.

Similar Messages

  • Is it possible to sum across groups

    Dear all,
    I want to define a template for AP cash requirement report to sum amount to be paid by vendor. The XML tree structure is to first group by Due Date and then group by Vendor. Therefore, the invoices to be paid can be under different Due Date groups. My question is, is it possible to sum by Vendor name regardless which Due Date group (the parent group) it belongs to?
    Thanks!
    Sandy

    Hi,
    Seems the XML tree is not allowed to be posted here. Please find it in the link below. G_Date is a parent group of G_Vendor. I want to be able to sum by vendor regardless of the which G_Date group it is belonged to. Please advise. Thanks!
    https://communities.oracle.com/portal/server.pt/community/view_discussion_topic/216?threadid=80778&aggregatorResults=T80778T79511T79424T78340T78009T76654T70958T47945T46834T45020&returnUrl=https://communities.oracle.com/portal/server.pt/community/discussions/209#80778

  • Matrix report with two across groups

    Hi all,
    I am facing a problem in making a multi line matrix report.
    actually I need to make a matrix report with two "across groups", but unable to get desired result.
    if any body has any idea, please share with me.
    regards
    Ata

    No,
    you must have only 1 query which extracts all your data:
    A,q1,10
    A,q2,20
    A,q3,30
    B,q1,40
    B,q3,50
    C,q2,60
    C,q3,70
    Open report builder and create a new report from wizard.
    Select the first option accordingly with your requirements and go next.
    Type a name for your report in the title field then select "Matrix" as layout and go next.
    Select SQL Query and go next.
    Type your query.
    Select the data you want on the rows (i.e. A, B, C...) and click on the ">" button in the Matrix Row Fields section, then go next.
    Select the data you want on the columns (i.e. q1, q2, q3...) and click on the ">" button in the Matrix Column Fields section, then go next.
    Select the data you want on the cells(i.e. 10,20,30...) and click on the "Sum >" button in the Matrix Cell Fields section, then go next.
    Add some totals, if you need them.
    Go next and finish.
    Now you have a report with the following layout:
             Q1           Q2            Q3       TOT
    A        10           20            30        60
    B        40                         50        90
    C                     60            70       130
    TOT      50           80           150       280Bye
    Raffy

  • How do I sum across the same table in multiple sheets?

    So I'm trying to figure out an annoying problem.
    I have a largish (100's) amount of data with each collection being a table in a sheet, one sheet per data collection. This means I have 100's of sheets, each with the same table name and layout. Each sheet has several hundred data points in it.
    How do I do a sum across all of the same table in all the sheets?
    For example I want to do Sum('Data Sheet Number *'::'Table 1'::A1) to get a sum of everything in all the A1 cells of all the sheets named 'Data Sheet Number ' followed by anything (I'm using the star in the same way one would do it in a shell...)
    Thanks!
    Message was edited by: unusedusername
    Message was edited by: unusedusername

    To respond to WWJD: I was handed the data and I don't have any control over it's format...
    I found the answer in the forums though, so I guess I'm answering my own question
    http://discussions.apple.com/thread.jspa?messageID=6203991&#6203991
    The auto-filling INDIRECT reference worked very well for me.

  • How to store the value of sum of group in Crystal Report at the runtime!

    Hello all,
    I creates a Formula Field that hold the value of Sum of Group in Crystal Report. I would like to know how to store it in a variable and pass it to store procedure. Is it an option in Crystal report to do it. I knew that Crystal Report can cache the report for sharing. My detailed issue as following:
    - Created a Formula Field named TOTAL AMOUNT that calculated the complex expression. This TOTAL AMOUNT is dynamic based on group and variables.
    - I would like to store that value from TOTAL AMOUNT and pass it to the stored procedure parameter IN.
    Any helps are much appreciated. Thanks.

    I doubt that this is possible since it would only calculate this value once the report has data.  This sounds more like a report design question that should be asked over [here|SAP Crystal Reports;

  • Sum Current Group With filter

    Dear All,
    I have problem to sum data using filter/conditon
    i want to sum data like this:
    No Budget SM GG
    1.2 *400 200*
    1.2.1 100 100
    1.2.2 200 200
    1.2.3 300 300
    1.3 400 400
    and using
    <?sum(current-group()/TotalPrice[.!='' and PaymentAllocation='GG'])?>
    but show no data
    i also tried
    <?xdoxslt:set_variable($_XDOCTX, ’INITGG’, xdoxslt:get_variable($_XDOCTX, ’INITGG’)
    +xdoxslt:ifelse(PaymentAllocation='GG',xdoxslt:ifelse(TotalPrice[.!=''],TotalPrice,0),0))?>
    but nothing happen, seem the code didn't recognized the group(have 2 group inside)
    Please help me
    Thank so much
    Regards
    Cecilia

    You can use <?sum(current-group()/TotalPrice[.!='' and ../PaymentAllocation='GG'])?>

  • Problem: Building an Across Group Report

    Hello all,
    I have an Across Group Report, but can't create a design / layout what i want (explained more detail as shown on the images).
    Current report when it's running:
    http://img259.imageshack.us/img259/750/01before.jpg
    The final layout that what i want:
    http://img9.imageshack.us/img9/1723/02after.jpg
    Environments:
    - Oracle Developer Reports 10g R2
    - Oracle Database 10gR2
    Anyone have an idea?
    Thanks.
    Best regards,
    Rob

    Hi,
    Can you please attached your layout Formate. Given Link is not working

  • Summing across columns

    Sorry, this is a very basic question that I haven't found the answer to when searching.
    I am setting up a basic table to keep track of business receipts.  I would like the total to be automatically filled in as I tab across the row.
    I have  Amount   Tax   Shipping     Total    after I fill in the columns, is it possible for the total to be automatically summed?
        ie        $10.00   $0.50                   $10.50
    I've tried a few ways, but have not gotten it to work on each row.
    Thanks
    - Jill

    Sure, you can sum across as easily as you can down. In this screenshot I used your figures & selected the three cells across & then dragged the sum shortcut to the last cell. You can then fill down with that formula by dragging the tiny circle.

  • Reset Group Sum at group change .... Urgent......

    Hi,
    I ve 4 groups in my report as a,b,c,d . and the structure is
    a
    |--> b
    |-> c
    |-> d
    ie. group d is nested in c, c is nested in b , b is nested in a.
    I want sum of group d . But at the same time when any of groups a,b,c changes , sum should be reset .
    Plz let me know how to reset sum on changing any of the groups a,b,c in same hierarchy.

    Hi
    Try to set it in the properties of the sum.
    Ott Karesz
    http://www.trendo-kft.hu

  • Eliminating NULLs for SUM(current-group)

    I face the following problem:
    I have some NULL values in my data which I elimnated by a <?xdofx:decode(FIELD,'',0,FIELD)?>
    add. I have defined a summary field with <?sum (current-group()/FIELD)?> that results in "NaN" because of the NULLs.
    But decode doesn't work in the sum(c... ) !?
    Any help is appreciated.
    Dirk

    Hi,
    I didn't know about the to_number, that's useful to know.
    It get's a little ugly in your template but you can work around have the sum before the for-each. The answer is to have a for-each purely to create the sum. I've had to do it for a couple of templates.
    I usually put the code in a template to make it easier to read and the not put too much code in to a cell in a table. Try the following:
    <?template:t_sumdata?>
    <?for-each:xxx?>
    <?if:ELEMENT!=''?>
    add to variable
    <?end if?>
    <?end for-each?>
    <?end template?>
    The above code can go anywhere in your template, I normally put them at the end. To reference this just put
    <?call:t_sumdata?><?get variable value?>
    where you want the total to appear.
    Thanks
    Paul

  • Sum and group by using CAML query

    Is there any way to get the SUM of values with group by ID using CAML query?
    I have a custom list, in that I have ID and Value columns as below
          ID         Value1      Value2
          1             10             4
          2              5              3
          1             15             2
          3             20             1
    I want to get result:
         ID          Value1        Value2
         1             25                6
         2             5                  3
         3             20                1
    I used CAML query:
    <View>
    <Query>
    <Where>
    <IsNotNull>
    <FieldRef Name="ID" />
    </IsNotNull>
    </Where>
    <GroupBy Collapse="FALSE">
    <FieldRef Name="ID" />
    </GroupBy>
    </Query>
    <ViewFields>
    </ViewFields>
    <Aggregations Value="On">
    <FieldRef Name="Value1" Type="SUM" />
    <FieldRef Name="Value2" Type="SUM" />
    </Aggregations>
    </View>
    But
    this query returns all the records
    that satisfy the condition <Where>.
    I
    do not correctly?

    You need to work with current view based aggregation. Please check below threads for your reference.
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/dda5735a-fecf-403f-9495-1b63617d2fbf/question-on-a-caml-query?forum=sharepointdevelopmentlegacy
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/24e88d6a-ee15-4d81-a5fe-504c7bd14e46/how-to-sum-a-column-value-using-caml-query?forum=sharepointdevelopment
    Hope this helps.
    My Blog- http://www.sharepoint-journey.com|
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful
    I've seen these
    issues and articles and do them, but
    does not work. I use object mozhel
    Sharepoint (javascript).

  • Select Empno,name,sum()..group by empno only  Is this possible?

    select empno,name,sum(sal) from emptable where year=' ' groub by empno order by empno.
    this query getting error because i didn't include empname in group by.
    But if i include this name, my sum is not correct.
    so i want to empno,name but i don't want to include name in group by. Is this possible?
    My oracle verion is 8.
    IS any other solution to solve this problem?
    Thanks in advance.

    i want to empno,name but i don't want to include name in group by. Is this possible?<br>
    <br>
    No. It isn't.
    <br>
    select empno,name,sum(sal) over (partition by empno) <br>
    from emptable
    <br>where year=' '
    <br>
    -- <s>groub by empno</s>
    <br>
    order by empno;

  • Find Sum of grouped events by date

    I'm using Report Builder 10.50.2500.0
    I've been trying to do this for awhile and have run out of ideas to try.  I think it's a simple solution but I can't figure it out.
    I have a database that is used for events. A booking can have several different events associated with it, even on the same day at different times.  The events can be classified as breakfast, lunch or dinner events.
    The report is grouped by type of event, then by event date (not datetime, the overall date), then grouped by booking.
    Basically, I need the sum the total attendance of each breakfast, lunch, and dinner event by date and by booking.
    For breakfast events I have this code on the Event Classification group row:
    =iif(Fields!EventClassification.Value = "Breakfast",SUM(Fields!CurrentAttendance.Value),0) and the same for lunch and dinner. This works except when when there is more than one event per day.
    For example, on 6/11/13 there is one lunch event and one dinner event.  The report shows
    Date
    EventName
    Breakfast
    Lunch
    Dinner
    6/11/13
    EventName
    0
    50
    0
    6/11/13
    EventName
    0
    0
    50
    When what I want is:
    Date
    EventName
    Breakfast
    Lunch
    Dinner
    6/11/13
    EventName
    0
    50
    50
    Any ideas?  I've tried using group variables and passing to a report variable and acting on that but that didn't work out properly.

    Hi Jmelinda,
    In order to achieve your requirement, we can refer to the following steps:
    In the Row Groups pane, right-click the Details group to add a parent group grouped by Date field.
    Right-click the Date group to add a parent group grouped by Date field.
    Right-click the Date group to add a total row after the group.
    Delete the second and third columns with “Delete columns only” option for Date field.
    Type the expression below to the total row for Breakfast column, and the same for lunch and dinner:
    =sum(iif(Fields!EventClassification.Value = "Breakfast", Fields!CurrentAttendance.Value, 0))
    Set the visibility of second row to Hide.
    The following screenshot is for your reference:
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • SUM WITHOUT GROUP CLAUSE

    I want to sum the total of Positive Balances and Negative Balances in table. My DDL is as under:-
    CREATE TABLE LUQMAN
    (ID NUMBER(1),
    AMOUNT NUMBER(5));
    INSERT INTO LUQMAN VALUES(1,20000);
    INSERT INTO LUQMAN VALUES(1,-2000);
    INSERT INTO LUQMAN VALUES(1,5000);
    INSERT INTO LUQMAN VALUES(1,20000);
    INSERT INTO LUQMAN VALUES(1,2300);
    INSERT INTO LUQMAN VALUES(2,-50000);
    INSERT INTO LUQMAN VALUES(2,-2000);
    INSERT INTO LUQMAN VALUES(2,5000);
    INSERT INTO LUQMAN VALUES(2,20000);
    INSERT INTO LUQMAN VALUES(2,2300);
    INSERT INTO LUQMAN VALUES(3,20000);
    INSERT INTO LUQMAN VALUES(3,-2000);
    INSERT INTO LUQMAN VALUES(3,5000);
    INSERT INTO LUQMAN VALUES(3,20000);
    INSERT INTO LUQMAN VALUES(3,2300);
    INSERT INTO LUQMAN VALUES(4,-50000);
    INSERT INTO LUQMAN VALUES(4,-2000);
    INSERT INTO LUQMAN VALUES(4,5000);
    INSERT INTO LUQMAN VALUES(4,20000);
    INSERT INTO LUQMAN VALUES(4,2300);
    COMMIT;
    The query should return One Row Answer as under:-
    POSITIVE NEGATIVE
    90600 -47100
    I tried following but could not got the correct answer.
    SELECT CASE WHEN ID IN (1,2,3,4)
    AND SUM(AMOUNT)>0 THEN SUM(AMOUNT) ELSE 0 END POSITIVE,
    CASE WHEN ID IN (1,2,3,4)
    AND SUM(AMOUNT)<0 THEN SUM(AMOUNT) ELSE 0 END NEGATIVE
    FROM LUQMAN;
    Any Idea please, how to return above One Single Row ? I want one cumulative balance, not by ID Group.
    Thanks and Regards,
    Luqman

    SQL> ed
    Wrote file afiedt.buf
      1  select sum(positive),sum(negative) from
      2  (
      3  select case when sign(amount)=1 then amount end positive,
      4  case when sign(amount)=-1 then amount end negative from LUQMAN
      5* )
    SQL> /
    SUM(POSITIVE) SUM(NEGATIVE)
           149200       -108000
    SQL> SELECT * FROM LUQMAN
      2  /
            ID     AMOUNT
             1      20000
             1      -2000
             1       5000
             1      20000
             1       2300
             2     -50000
             2      -2000
             2       5000
             2      20000
             2       2300
             3      20000
            ID     AMOUNT
             3      -2000
             3       5000
             3      20000
             3       2300
             4     -50000
             4      -2000
             4       5000
             4      20000
             4       2300
    20 rows selected.
    luqman123 wrote:Hi,
    Your query returning wrong total.Can you check your inserts again ...
    HTH

  • Finding Sum of grouped lines / Tables EKKO, EKPO

    Hi, am using the following tables:
    TABLES: ekko,ekpo.
    with Inner Join
    select ekkobukrs ekkoebeln ekkoaedat ekkobsart ekkoekgrp ekkolifnr ekkowaers ekkowkurs ekkoernam ekpobrtwr
       into CORRESPONDING FIELDS OF TABLE itab from ekko
        inner join EKPO on ekPOEBELN = ekkoebeln.
    end-OF-SELECTION.
    Basically i want to group the result of this SQL statement by Purchasing Doc (ekko~ebeln) and display the
    sum of Gross value (ekpo~brtwr) for the line items of  each Purchasing Doc.
    Note: i want the Purchasing Doc to appear one time only in the report
    i have tried the following :
    select  ekkobukrs ekkoebeln ekkoaedat ekkobsart ekkoekgrp ekkolifnr ekkowaers ekkowkurs ekkoernam sum(  ekpobrtwr )
       into  CORRESPONDING FIELDS OF TABLE itab from ekko
       inner join EKPO on ekPOEBELN = ekkoebeln
    WHERE ekkobukrs IN S_bukrs AND ekkobsart IN s_bsart
    Group By  ekkoebeln ekkobukrs ekkoaedat ekkobsart ekkoekgrp ekkolifnr ekkowaers ekkowkurs ekko~ernam.
    then loop through the ITAB:
    LOOP at itab.
    write:/ itab-bukrs under 'Company Code',
             itab-ebeln UNDER 'PO-Number',
             itab-aedat UNDER 'Date' ,
             itab-bsart UNDER 'Doc-Type'  ,
             itab-ekgrp UNDER 'Purchase-Grp' ,
             itab-lifnr UNDER 'Vendor' ,
             itab-waers UNDER 'Currency',
             itab-wkurs UNDER 'Rate' ,
             itab-brtwr under 'Gross Value',
             itab-ernam UNDER 'Created By'.
    ENDLOOP.
    but it is not working with me, am not able to show the result of sum(  ekpo~brtwr ) am getting 0 in all lines
    thanks a lot for your help

    " My Full Code.
    TABLES: ekko,ekpo,ekbe,rbkp.
    data: BEGIN OF itab OCCURS 0,     "EKKO TABLE"
          inco1 like ekko-inco1,
          inco2 like ekko-inco2,
          bukrs like ekko-bukrs,
          ebeln like ekko-ebeln,
          aedat like ekko-aedat,
          bsart like ekko-bsart,
          ekgrp like ekko-ekgrp,
          lifnr like ekko-lifnr,
          waers like ekko-waers,
          wkurs like ekko-wkurs,
          ernam like ekko-ernam,
          BRTWR LIKE ekpo-brtwr,
      end of itab.
    SELECT-OPTIONS : s_bukrs FOR itab-bukrs OBLIGATORY,
                     s_ebeln for itab-ebeln ,
                     s_aedat FOR itab-aedat ,
                     s_bsart for itab-bsart ,
                     s_ekgrp FOR itab-ekgrp ,
                     s_lifnr FOR itab-lifnr ,
                     s_budat FOR jtab-budat ,
                     s_bewtp for jtab-bewtp .
    DATA ProceesITAB LIKE SORTED TABLE OF ITAB WITH UNIQUE KEY TABLE LINE.
    AT SELECTION-SCREEN on s_bukrs.
    START-OF-SELECTION.
    select ekkobukrs ekkoebeln ekkoaedat ekkobsart ekkoekgrp ekkolifnr ekkowaers ekkowkurs ekkoernam ekpobrtwr
       into CORRESPONDING FIELDS OF TABLE itab from ekko
        inner join EKPO on ekPOEBELN = ekkoebeln.
      end-OF-SELECTION.
    LOOP at itab.
    write:/ itab-bukrs under 'Company Code',
             itab-ebeln UNDER 'PO-Number',
             itab-aedat UNDER 'Date' ,
             itab-bsart UNDER 'Doc-Type'  ,
             itab-ekgrp UNDER 'Purchase-Grp' ,
             itab-lifnr UNDER 'Vendor' ,
             itab-waers UNDER 'Currency',
             itab-wkurs UNDER 'Rate' ,
             itab-brtwr under 'Gross Value',
             itab-ernam UNDER 'Created By'.
    ENDLOOP.
    TOP-OF-PAGE.
    write:/70 'Company'.
    uline.
    skip.
    write:/5 'Company Code',25 'PO-Number',40 'Date',55 'Doc-Type',70 'Purchase-Grp',85 'Vendor',100 'Currency',115 'Rate',125 'Created By',
    140 'Gross Value'.
    ULINE.
    SKIP.
    Edited by: YasinN on Mar 24, 2010 9:45 AM

Maybe you are looking for

  • Apple's Tip of the week - Two Seconds to Sleep anomaly

    Apple states in its tip of the week "Tip of the Week Two Seconds to Sleep Want the fastest way to put your Mac right into a deep, sleepy-bear hibernation-like sleep (no whirling fan, no dialogs, no sound - nuthin' - just fast, glorious sleep). Just p

  • File download via servlet doesn't work with IE via https

    I have a URL from a jsp page which points to a struts action servlet. This works with firefox via http and https. With IE it works via http but it doesn't work via https. The error message I get is "Internet Explorer cannot download ...File_name.doc

  • Current block not in the list of the block_menu LOV

    Hi all, In the key-crerec trigger of my forms I call do_key('block_menu'). I perform some actions and the built-in block_menu in the key-menu trigger. And what I noticed is that the current block where I launched the key-crerec trigger is not listed

  • Can't open Office documents from network share

    Dear, I have a user named X that can't open Office documents from two specific shares. We call this shares T and U. When the user X opens Office documents the error message is "...xlsx can't be opened". The problem is not client specific because when

  • MacBook Pro won't allow website to use camera

    Hey fellows. So, I've been trying to use a few different websites, the likes of www.6rounds.com and www.stickam.com, that allow you to video chat with people. Whenever I try to make sure my camera is working, though, it refuses to acknowledge it. I h