Issue in calculating sum on a column at the end of the report in Pivot view

Hi,
I have some columns like Hierarchy column A, Non Hierarchical columns B, C and a measure D.
In Pivot view under rows I have placed columns A,B and C in Columns and D in measures. If I try to calculate sum of values at the end of report by using option Sum At the End on columns we are getting an error that grouping by function should be in the select clause of the query.
If I duplicate the column C and put it in rows then I am able to see totals at the end but values are displayed in multiple rows and it won't meet our requirement.
Any suggestion or workarounds on this will be helpful.
Thanks,
Vj

Hi,
let me explain it better..
Col A: GL Segment Hierarchy which will display Level1 to Level n Names
Col B: Level n Code.
Col C: Fiscal Period
Col D: Amount
Now col A and B are in Rows, col c in columns and col D in measures in a pivot view.
Issue is we are unable to have total of measure values at the end of report by using sum at the end.

Similar Messages

  • How to calculate the total of a calculated column in a list view at the end of the view?

    I have a view with the following columns ProductName, Quantity, Price, Total The total column is a calculated column which is the product of quantity and price. I want to place the sum of the total column by the end of the list view. I can do this with
    the price and quantity but not with the total column. how do I do this?

    You can use SharePoint Designer and calculate the total in xslt view. Refer to the following post for more information
    http://community.bamboosolutions.com/blogs/bambooteamblog/archive/2009/04/24/how-to-total-calculated-columns-in-a-sharepoint-list.aspx
    http://blog.metrostarsystems.com/2012/12/03/jennys-sharepoint-tip-sum-calculated-columns/
    Cheers,

  • How to display the total at the end of the column in the report.

    Hi all,
    Could any one please intimate, how to display the total at the end of the column. For example, i have a column, "sales" as the Key figure, and it has the data for all the transactions. Now, i would like to display the total at the end of the report, below the same column.
    Similarly, for all the other columns in the report, i need to display the total for all the columns in the report.
    Thanks & Regards,
    A.V.N.Rao

    Hi All,
    Thanks for many suggestions. I tried by providing the "Total" under "Calculate Results as" and also "Counter for all detailed values" under "Calcuate Single Values as", in the  "Calculations" tab of the key figure, but i am unable to get the information. Again, i am providing the requirement below:
    CHAR - A   CHAR - B   TIME CH. - 1 KF -1  KF- 2 KF - 3
    1                     RAM        2012           1         50      50
    2                     SAM         2012          2         100    200
    Result                                               3           150   250
    Assume KF -1 as  "Qty." KF-2  as "Price" KF-3 as "Sales".
    Please intimate the solution.
    Thanks & Regards,
    A.V.N.Rao.

  • How to print SUM & COUNT at the end of the XML template

    Hello,
    I am generating a payment file in oracle Payments and at the end of the file, I would also like to add a trailer record with sum of the payments and number of payments. Can anyone have any suggestions on having a trailer record with SUM & COUNT.
    Thanks,

    You can use,
    COUNT and SUM of the column to get those values.
    In extext, add a new record and add these function on columns.

  • I have an Iad2 and ever since ios6-there are issues.I get occasional lock-ups and have to reboot. The WSJ app freezes when running their videos to the end. The only work-around is to stop the video before it's over. Worse than windows me !!!!!

    My Ipad2 worked perfectly before ios6 upgrade. It now freezes occasionally and I have to reboot to get it to work. Also the WSJ app will now freeze if I try and run one of their videos that is imbedded in the article. My only work-around is to stop (press done) before the end of the video or I have to do a total reboot. The problems remind me of Windows ME . Will Apple resolve these issues or become more like Microsoft. Hopefully there will be a restore button in the future like Microsoft was forced to do because a lot of upgrades are just terrible. Am I crazy or are there other people having the same issues with ios6, or could this just be a coincidence and my ipad2 is starting to fail just when ios6 arrives ?

    I know this will not help but, the bluetooth headset I purchased for my wife works great and it pairs with our car and our sound bar in the livingroom (Motorola Droid Razr) 98.72.16.XT912.Verizon.en.US
    However I did not upgrade over the air but from a android web site and placed it on my external sd card. I believe this made the difference in why we had no issues and upgraded functionality has been great.
    Please note when I mention these bluetooth devices I mean the Razr connects with no problems.
    It also had no internet issues and none of the problems others have complained about in other threads.
    unfortunately when you say thousands have these issues I cannot say that is accurate. The hope is when large numbers of owners have updated to the Jelly Bean and are complaining inmase then Motorola will issue a patch to verizon to get out to the affected users.
    Of course now that Google owns Motorola Mobility and has laid off loads of workers it may never issue an os patch.

  • When I create a new project in iMovie and drop clips into it, it plays the first one and then quits right near the end of the second clip.  I have re-started my computer, tried a new project etc, and no luck, does anyone know how to fix this issue?

    When I create a new project in iMovie and drop clips into it, it plays the first one and then quits right near the end of the second clip.  I have re-started my computer, tried a new project etc, and no luck, does anyone know how to fix this issue?

    This is a part of the larger MacBook Pro connectivity issue. There are several related threads dealing with the MBP's networking problems. If your unit is suffering from this type of difficulty, good luck ... (or a long ethernet cable)
    (PS Everybody please make noise on this one so apple comes up with a solution.)
    < Edited by Host >

  • Please help urgent Calculation at the end of alv report

    Hi ..
    It is necessary to define clearly  col1 first record is 10 col2 first record is 20 ..
    col1 second record is 15 col2  second record is 25 .
    COL3 first value is 10 / 20 .
    col3 second value is 15 / 25 .
    This datas come from internal table .
    When I add at the end for all columns it get wrong calculation or lets say I want to do like total col1 10+ 15 total  col2 is 20+ 25 . Total column3 is would like to be 25 / 45 .
    How can I insert a line which is doing this operation in my alv .

    try this
    first
    DATA : SAT_EVENTS     TYPE SLIS_T_EVENT.
    DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          I_LIST_TYPE = 0
        IMPORTING
          ET_EVENTS   = SAT_EVENTS[].
      READ TABLE SAT_EVENTS WITH KEY NAME =  SLIS_EV_TOP_OF_PAGE
                               INTO LS_EVENT.
      IF SY-SUBRC = 0.
        MOVE 'TOP_OF_PAGE' TO LS_EVENT-FORM.
        APPEND LS_EVENT TO SAT_EVENTS.
      ENDIF.
      READ TABLE SAT_EVENTS WITH KEY NAME =  SLIS_EV_END_OF_LIST
                             INTO LS_EVENT.
      IF SY-SUBRC = 0.
        MOVE 'END_OF_LIST' TO LS_EVENT-FORM.
        APPEND LS_EVENT TO SAT_EVENTS.
      ENDIF.
    form for end of list
    FORM END_OF_LIST.
      DATA: P_HEADER TYPE SLIS_T_LISTHEADER,
            PA_HEADER TYPE SLIS_LISTHEADER.
      DATA: INFO(100).
    info = <your calculated value for col3>
    PA_HEADER-TYP = 'S'.
    PA_HEADER-INFO = INFO.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
        IT_LIST_COMMENTARY       = P_HEADER
      I_LOGO                   =
         I_END_OF_LIST_GRID       = 'X'
    ENDFORM.                    "END-OF-LIST
    in REUSE_ALV_GRID_DISPLAY pass
    IT_EVENTS =  SAT_EVENTS[]
    hope this will work
    regards
    Shiba dutta
    Message was edited by:
            SHIBA DUTTA

  • How to put total for a column at the end of the report

    I have a field called requests. at the end of every print page i want the total no. of requests to be printed. how can i do that? please help urgent

    If your querying requests, and your query pulls back 50 rows of data, would you say that is 50 requests in total?
    A summary column is quite simple - it counts the number of rows in a given report group. If the number of rows brought back is the total number of requests, than just create it to count some column in that group (request num..etc). If you set it to reset at the report level, it should just work fine

  • Want to Change the Column Indetn Color of Measure Label in a Pivot View

    Hello,
    I have used the measure labels in the "ROWS" of a pivot table and there is a column header or indent on the top these measure label which is BLUE by default .My requirement is to change that to a different color and if possible put some text there.
    (to be simple i see a .PTindent cell ,on the top of measure label which i want to edit from dashboard or reporting end without making any changes to the CSS entry files,becuase this entry can cause effect to all the table already in the environment)
    Thanks
    Raghu
    Edited by: user13136841 on Nov 22, 2010 11:56 AM

    Let's try this step by step:
    1) In your report add a Static Text view.
    2) Add the formula I described:
    <style>.PTIndentCell {background-color: #000000;}</style> 3) Check the "Contains HTML Markup" checkbox.
    View the Compound Layout or in the Dashboard (viewing the Pivot Table will NOT show the change.)
    If you can't see anything than the next thing to check is if you can view HTML. Go to a CHAR column and click on the Data Format tab. What choices do you see if you attempt to override the format? If you see HTML, then okay. If you don't, but only see "Plain Text," than HTML is not enabled. The default for OBIEE is to not allow HTML. You will need to change your instanceconfig.xml file and set the HardenXSS to false. See the link below:
    http://download.oracle.com/docs/cd/E12096_01/books/AnyWebAdm/AnyWebAdm_CustAnyWeb23.html

  • I can't get the Terms and Conditions for iTunes to be emailed to me from my iPhone PLUS there is no "accept" button at the end of the 54 pages listed.  Anyone else having issues?

    I just upgraded to 7 and now I can't download any apps, because iTunes says I have to agree with their new terms and conditions.  But there's no place to agree on the page!!  Anyone have a solution?  i tried to press the "email it to me" button, but that won't work either.  Sigh.

    Yes me too, tried re setting and enabling changes but no agree button anywhere?

  • Hello, my develop module has been disabled at the end of the trial period but I have purchased Creative Cloud 2 days ago.  Anyone have any assistance on this issue?

    How do I reactivate my develop module? I already have Creative Cloud but it keeps telling me to renew my membership.

    You will have to clear the cache mentioned on this advisory:
    Lightroom doesn't launch or returns "Develop module is disabled" error after 5.5 update

  • Summing up a Column in ALV report

    Hi All,
    I have developed an ALV Report which will display Invoices and other details.
    Now i need to display the sum of NETWR column, if user wish to select that column and click the "SUM" icon.
    As of now, if i select the NETWR column and click 'SUM" column, i am getting Runtime error.
    How to resolve this issue?
    Regards
    Pavan

    Hi Pavan,
    ALV GRID CONTROL:
    This task is performed by the SAP Control Framework.
    The R/3 System allows you to create custom controls using ABAP Objects. The application server is the Automation Client, which drives the custom controls (automation server) at the front end.
    If custom controls are to be included on the frontend, then the SAPGUI acts as a container for them.
    Custom controls can be ActiveX Controls or JavaBeans.
    The system has to use a Remote Function Call (RFC) to transfer methods for creating and using a control to the front end.
    ABAP objects are used to implement the controls in programs.
    An SAP Container can contain other controls (for example, SAP ALV Grid Control, Tree Control, SAP Picture Control, SAP Splitter Control, and so on). It administers these controls logically in one collection and provides a physical area for the display.
    Every control exists in a container. Since containers are themselves controls, they can be nested within one another. The container becomes the parent of its control. SAP containers are divided into five groups:
    SAP custom container: Displays within an area defined in Screen Painter on screens or sub screens.
    Class: CL_GUI_CUSTOM_CONTAINER
    SAP dialog box container: Displays in a modeless dialog box or as a full screen. Class:
    CL_GUI_DIALOGBOX_CONTAINER
    SAP docking container: Displays as docked, resizable sub-window with the option of displaying it as a modeless dialog box. Class: CL_GUI_DOCKING_CONTAINER
    SAP splitter container: Displays and groups several controls in one area - that is, splits the area into cells Class: CL_GUI_SPLITTER_CONTAINER
    SAP easy splitter container: Displays controls in two cells, which the user can resize using a split bar. Class: CL_GUI_EASY_SPLITTER_CONTAINER.
    In the control, you can adjust the column width by dragging, or use the 'Optimum width' function to adjust the column width to the data currently displayed. You can also change the column sequence by selecting a column and dragging it to a new position.
    Standard functions are available in the control toolbar. The details display displays the fields in the line on which the cursor is positioned in a modal dialog box.
    The sort function in the ALV Control is available for as many columns as required. You can set complex sort criteria and sort columns in either ascending or descending order.
    You can use the 'Search' function to search for a string (generic search without *) within a selected area by line or column.
    You can use the 'Sum' function to create totals for one or more numeric columns. You can then use the "Subtotals" function to set up control level lists: You can use the 'Subtotal' function to structure control level lists: select the columns (non-numeric columns only) that you want to use and the corresponding control level totals are displayed.
    For 'Print' and 'Download' the whole list is always processed, not just the sections displayed on the screen.
    You can define display variants to meet your own specific requirements. For information on saving variants, see 'Advanced Techniques'.
    The ALV grid control is a generic tool for displaying lists in screens. The control offers standard functions such as sorting by any column, adding numeric columns, and fixed lead columns .
    Data collection is performed in the program (with SELECT statements, for example) or by using a logical database. The data records are saved in an internal table and passed on to the ALV control along with a field description.
    The field description contains information about the characteristics of each column, such as the column header and output length. This information can defined either globally in the Dictionary (structure in the Dictionary) or in the field catalog in the program itself. You can also merge both techniques.
    The ALV link is a standard function of Query and QuickViewer. If multiline queries or Quick View lists have been defined, they will automatically be compressed to a single line and output in the ALV control as a long, single line list.
    Use Screen Painter to create a sub screen container for the ALV grid control. The control requires an area where it can be displayed in the screen. You have to create a container control that determines this area.
    Use the corresponding icon in the Screen Painter layout to create the container control. The size of area "MY_CONTROL_AREA" determines the subsequent size of the ALV control.
    The valid GUI status must be set at the PBO event in the flow logic of the ALV subscreen container.
    The OK_CODE processing for the cancel functions must be programmed at the PAI event.
    The reference variables for the custom container and the ALV grid control must be declared.
    To create reference variables, use ABAP statement TYPE REF TO .
    The global classes you need to do this are called cl_gui_custom_container (for the custom container control) and cl_gui_alv_grid (for the ALV grid control).
    The global classes are defined in the Class Builder. You can use the Class Builder to display information for the methods, their parameters, exceptions, and so on.
    Use ABAP statement CREATE OBJECT to create the objects for the container and the ALV control. Objects Are instances of a class.
    When an object is created (CREATE), method CONSTRUCTOR of the corresponding class is executed. The parameters of method CONSTRUCTOR determine which parameters have to be supplied with data when the object is created. In the above example, object alv_grid is given the name of the container control (g_custom_container) in exporting parameter i_parent, which links the two controls. For information on which parameters method CONSTRUCTOR possesses and which of these parameters are required, see the Class Builder.
    Objects should only be created once during the program. To ensure that this is the case, enclose the CREATE OBJECT statement(s) in an IF IS INITIAL. ... ENDIF clause. The objects must be generated before the control is displayed for the first time - that is, during the PBO event of the ALV subscreen container.
    To display the requested dataset in the ALV control, the data must be passed on to the control as an internal table, and a field description must exist indicating the order in which the columns will be output.
    In the simplest case, the field description can use a structure from the Dictionary. The Dictionary also determines the technical field attributes like type and length, as well as the semantic attributes like short and long texts. The ALV control uses this information to determine the column widths and headers. The column sequence is determined by the field sequence in the structure.
    If no suitable structure is active in the Dictionary, or you want to output internal program fields in the control, then you will have to define information like the output length and column header in the field catalog.
    In a typical program run, the dataset is read first (SELECT ....), the internal table is filled with the data to display (... INTO TABLE ...), and ABAP statement CALL SCREEN is then used to call the ALV sub screen container.
    The data transfer to the ALV control takes place during the call of method
    set_table_for_first_display from class cl_gui_alv_grid. The method call must be programmed at the PBO event of the ALV subscreen container.
    The name of the Dictionary structure that supplies the field description is specified in exporting parameter i_structure_name. The name of the internal table that contains the data records to display is specified in changing parameter it_outtab.
    The field description for the ALV control can be ta ken from an active Dictionary structure (fully automatic), by passing a field catalog (manual), or through a mixture of the two options (merge).
    The field catalog is in internal table with type lvc_t_fcat. This type is defined globally in the Dictionary.
    Each line in the field catalog table corresponds to a column in the ALV control.
    The field characteristics (= column characteristics) are defined in the field catalog. The field catalog is in internal table with type lvc_t_fcat. Each line that is explicitly described in the ALV control corresponds to a column in the field catalog table.
    The link to the data records to output that are saved in internal table is established through field name . This name must be specified in column "fieldname" in the field catalog.
    This field can be classified through a Dictionary reference (ref_table and ref_field) or by specifying an ABAP data type (inttype).
    Column headers and field names in the detail view of an ALV control line can be determined in the field catalog in coltext and seltext, respectively.
    The position of a field during output can be determined with col_pos in the field catalog.
    If you want to hide a column, fill field no_out with an "X" in the field catalog. Hidden fields can be displayed again in a user display variant.
    Icons can be displayed in the ALV control. If you want a column to be interpreted as an icon, then the icon name must be known to the program (include .) and icon = "X" must be specified for this column in the field catalog.
    The above example shows a semi-automatic field description: Part of the field description comes from the Dictionary structure (sflight), while another part is explicitly defined in the field catalog (gt_fieldcat).
    The field catalog (internal table) is filled in the program and is passed on together with the name of the Dictionary structure during the method call. The information is merged accordingly in method set_table_for_first_display.
    For a user to save display variants, parameters is_variant and i_save must be passed on during method call set_table_for_first_screen. To assign display variants uniquely to a program, at least the program name must be supplied in the transferred structure (gs_variant).
    Program names can be up to 30 characters long.
    If you only pass on the current parameters for is_variant, then existing variants can be loaded, but no new ones can be saved. If you use parameter i_save, you must pass on a variant structure with is_variant.
    I_SAVE = SPACE No variants can be saved.
    I_SAVE = 'U' The user can only save user-specific variants.
    I_SAVE = 'X' The user can only save general (shared) variants.
    I_SAVE = 'A' The user can save both user-specific and general (shared) variants.
    You can use parameter is_layout of method set_table_for_first_display, for example, to define the header in the ALV control and the detail display.
    To do this, define a query area in the program in accordance with Dictionary structure lvc_s_layo, and pass on the text to display in field -grid_title or -detailtitl.
    If you want to create print lists with zebra stripes, set field -zebra to "X". You can display a print preview for print lists by requesting standard function "Print".
    All parameters of method SET_TABLE_FOR_FIRST_DISPLAY from global class
    CL_GUI_ALV_GRID are defined in the Class Builder.
    Events are defined in global class cl_gui_alv_grid; you can use these events to implement user interaction within the program. To respond to a double -click on a table line, you must respond to event DOUBLE_CLICK.
    You receive control in the program, allowing you to implement interactive reporting - such as a full screen details list. The events for cl_gui_alv_grid are located in the Class Builder.
    To define an implement a local class in the program, you use a handler method. In this handler method, you program the functionality to trigger by a double -click in the output table.
    To activate a handler method at runtime, a class or an object from that class registers itself with an event using command SET HANDLER. The names of the IMPORTING parameters in the handler method correspond to the names of the EXPORTING parameters of the related event.
    In the above example, the local class is LCL_ILS and the handler method is ON_DBLCLICK. An object - ALV_DBLCLICK - is created and registers itself for event DOUBLE_CLICK.
    You can query parameter e_row-index to determine which output line was requested by the double -click. This parameter corresponds to the line number of the output table (internal table with the data records to output). If you need information for the selected line, you have to read it with READ TABLE itab INDEX e_row-index.
    This subsequent read in the output table generally corresponds to the HIDE area in conventional reporting. You first have to make sure that the user has double -clicked a line in the output table (similar to the valid line selection with the HIDE technique).
    A field group can contain global data objects, but not data objects that have been defined locally in a subroutine or function module.
    You can use INSERT to specify both fields and field symbols. This makes it possible to dynamically insert a data object referred to by a field symbol into a field group at runtime. Any field symbols that have not been assigned are ignored, which means no new field is inserted into the field group.
    The EXTRACT statement writes all the fields of a field group as one record to a sequential dataset (transport takes place with similarly named fields). If a HEADER field group is defined, then its fields are placed ahead of each record as sort keys. You can then sort the dataset with SORT and process it with LOOP ...ENDLOOP. In this case, no further EXTRACT is possible.
    The INSERT statement is not a declarative statement: This means field groups can also be expanded in the program flow section.
    As soon as the first dataset of a field group has been extracted with EXTRACT, that field group can no longer be expanded with INSERT. In particular, the HEADER field group cannot be expanded after the first EXTRACT (regardless of the field group).
    When the GET events are processed, the logical database automatically writes hexadecimal zeros in all the fields of a node when it returns to an upper-level node in the hierarchy. Since the HEADER normally contains sort fields for all field groups, these hexadecimal zeros in the HEADER serve as a type of hierarchy key: The more zeros there are, the further up in the control level hierarchy you go.
    &#61550;&#61472;The SORT statement sorts the extract dataset in accordance with the defined field sequence in field group HEADER. The addition BY ... sets a new sort key.
    Each must be either a field of field group HEADER or a field group that consists only of fields of the field group HEADER. You can use the additions ASCENDING and DESCENDING to determine whether the fields are sorted in ascending (default) or descending order.
    Fields containing X'00' in the logical databases are always displayed before all other values during a SORT.
    Processing of an extract dataset always takes places within a LOOP. The contents of the extract dataset field are placed in program fields with the same names.
    The group change always involves the fields of the HEADER. Single record processing for extract datasets is performed using language element AT ( = field group).
    CNT() is not a statement, but instead a field that is automatically create d and filled when is a non-numeric field from field group HEADER and is part of the sort key. At the end of the group, CNT() contains the number of different values that the field recorded in this group level.
    SUM() is not a statement, but instead a field that is automatically created and filled when is a numeric field of an extract dataset. At the end of the group, SUM() contains the control total of field .
    *** and CNT are only available at the end of the group level or at AT LAST.
    Single record processing for extract datasets AT WITH is only performed when field group is immediately followed by field group in the temporary dataset.
    Loops over an extract dataset cannot be nested. However, several contiguous loops are permitted.
    The sequence of the control level changes within the LOOP must correspond to the sort sequence.
    Totals can only be calculated within control footer processing.
    Extracts allow only appends (EXTRACT), sorting (SORT) and sequential processing (LOOP).
    Once a SORT or LOOP has occurred, the intermediate dataset is frozen and cannot be expanded with EXTRACT. Operations that insert into or delete from EXTRACT datasets are not supported.
    Extracts allow for several record types (FIELD-GROUPS) with fields that can be set dynamically (INSERT is not a declarative statement!). Internal tables have a single, statically-defined line type.
    Internal tables use the sequence of table fields according to the declaration for the hierarchy of the control leve l. The control level structure for internal tables is therefore static, and is independent of which criteria were used to sort the internal table.
    Extracts do not depend on the field sequence for control level processing: a re-sort or a completely different control level process can take place. The control level structure for extract datasets is therefore dynamic. It corresponds exactly to the sort key of the extract dataset. The sort key is the sequence of fields from the field group HEADER, and is used to sort the extract dataset.
    Extracts rely on the compiler to determine which combinations of group levels and a cumulating field the control level totals desire. The desired control level totals are determined by the processing of LOOP ... ENDLOOP blocks. Internal tables build the control level total with the SUM statement.
    This procedure leads to high resource depletion for totaling control levels in internal tables.
    Regards,
    Chandru

  • How to calculate the individual sums of multiple columns in a single query

    Hello,
    Using Oracle 11gR2 on windows 7 client. I have a question on calculating sum() on multiple columns on different columns and store the results in a view. Unfortunately I could not post the problem here as it keeps on giving error "Sorry, this content is not allowed", without telling where or what it is! So I had to post it in the stack-overflow forum, here is the link: http://stackoverflow.com/questions/16529721/how-to-calculate-the-individual-sums-of-multiple-columns-in-a-single-query-ora
    Will appreciate any help or suggestion.
    Thanks

    user13667036 wrote:
    Hello,
    Using Oracle 11gR2 on windows 7 client. I have a question on calculating sum() on multiple columns on different columns and store the results in a view. Unfortunately I could not post the problem here as it keeps on giving error "Sorry, this content is not allowed", without telling where or what it is! So I had to post it in the stack-overflow forum, here is the link: http://stackoverflow.com/questions/16529721/how-to-calculate-the-individual-sums-of-multiple-columns-in-a-single-query-ora
    Will appreciate any help or suggestion.
    ThanksLooks like you want a simple group by.
    select
              yr
         ,      mnth
         ,      region
         ,     sum(handled_package)
         ,     sum(expected_missing_package)
         ,     sum(actual_missing_package)
    from test
    group by
         yr, mnth, region
    order by      
         yr, mnth, region;I wouldn't recommend storing your data for year / month in 2 columns like that unless you have a really good reason. I would store it as a date column and add a check constraint to ensure that the date is always the first of the month, then format it out as you wish to the client.
    CREATE TABLE test
         year_month                              date,
        Region                     VARCHAR2(50),
        CITY                       VARCHAR2(50),             
        Handled_Package            NUMBER,       
        Expected_Missing_Package   NUMBER,   
        Actual_Missing_Package     NUMBER
    alter table test add constraint firs_of_month check (year_month = trunc(year_month, 'mm'));
    ME_XE?Insert into TEST (year_month, REGION, CITY, HANDLED_PACKAGE, EXPECTED_MISSING_PACKAGE, ACTUAL_MISSING_PACKAGE)
      2  Values (to_date('2012-nov-12', 'yyyy-mon-dd'), 'Western', 'San Fransisco', 200, 10, 5);
    Insert into TEST (year_month, REGION, CITY, HANDLED_PACKAGE, EXPECTED_MISSING_PACKAGE, ACTUAL_MISSING_PACKAGE)
    ERROR at line 1:
    ORA-02290: check constraint (TUBBY.FIRS_OF_MONTH) violated
    Elapsed: 00:00:00.03
    ME_XE?Insert into TEST (year_month, REGION, CITY, HANDLED_PACKAGE, EXPECTED_MISSING_PACKAGE, ACTUAL_MISSING_PACKAGE)
      2  Values (to_date('2012-nov-01', 'yyyy-mon-dd'), 'Western', 'San Fransisco', 200, 10, 5);
    1 row created.
    Elapsed: 00:00:00.01
    ME_XE?select
      2        to_char(year_month, 'fmYYYY')    as year
      3     ,  to_char(year_month, 'fmMonth')   as month
      4     ,  Region
      5     ,  CITY
      6     ,  Handled_Package
      7     ,  Expected_Missing_Package
      8     ,  Actual_Missing_Package
      9  from test;
    YEAR         MONTH                REGION                         CITY                    HANDLED_PACKAGE EXPECTED_MISSING_PACKAGE ACTUAL_MISSING_PACKAGE
    2012         November             Western                        San Fransisco                       200                       10                      5
    1 row selected.
    Elapsed: 00:00:00.01
    ME_XE?Then you have nice a nice and easy validation that ensures you data integrity.
    Cheers,

  • Compute sum of two columns - display result in the third column

    Hello,
    I have a report and I want to compute sum of two report columns and display the total in the third column.
    For example: Sample_My_Report
    Col1 Col2 Total (Col1+Col2)
    3 7 10
    can anyone help me out with this issue.
    thanks.

    thanks for replying. One more thing is that
    How can I compute Avg for a particular column in a Master detail report. I need the avg(sal) to be displayed at the end of the report similar to sum(reports total).
    Can you help me out with this issue.
    thanks.

  • Display a sum of a column(field) in the view

    Hi
    I would like to show the sum of a revenue field(currency) in any view of the opportunity entity(only when revenue field exist in the view) , may be at the end of the view or as a alert message on button click., but sum should change dynamically based on
    the filters applied or selected records.
    E.g. Here Est. Revenue to be summed and displayed.
    Kindly help me... Thanks in advance.
    Rekha.J

    This is the Solution
    Add This Code to Desing Page:-
    <GridView id="GrdView1" Runat Server/>
    <asp:TemplateField HeaderText="Date" ItemStyle-Width="100px">
                            <ItemTemplate>
                               <%# Eval("Date","{0:MMM d,yyyy}").ToString()%>
                            </ItemTemplate>
                            <FooterTemplate>
                                Sub-Total:
                            </FooterTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Amount" ItemStyle-Width="118px">
                            <ItemTemplate>
                                <%# GetAmount(decimal.Parse(Eval("Amount").ToString())).ToString()%>
                            </ItemTemplate>
                            <FooterTemplate>
                                <%# GetToalAmount().ToString("")%>
                            </FooterTemplate>
                        </asp:TemplateField>
    </GrigView>
    In the cs file write the code on pageload as
    decimal TotalAmountPaid = 0;
        public decimal GetAmount(decimal Price)
            TotalAmountPaid += Price;
            return Price;
        public decimal GetToalAmount()
            return TotalAmountPaid;
    Then Run This..............................

Maybe you are looking for

  • BAPI_GOODSMVT_CREATE goods issue for tmovement type  261 not updating costs

    GMHEAD-PSTNG_DATE =  SY-DATUM.         GMHEAD-DOC_DATE   =  SY-DATUM.         GMCODE-GM_CODE    =  '03'.   "03 - MB1A - Goods Issue         GOODSMVT_ITEM-MOVE_TYPE   =   '261'.         GOODSMVT_ITEM-ENTRY_QNT   =   '1'. I am using BAPI_GOODSMVT_CREAT

  • Some software are not working properly,don't know why?

    I can't convert video files to mp3. I tried with different software;real player, format factory, etc. But every time pop up msg shows "RealConverter or format factory has stopped working. A problem caused the program to stop working correctly. Window

  • Mac mini hard disk keep crashing

    The hard disk of my Mac mini has been replaced twice during the one year warranty period. It crashed again  recently and I was unable to reformat or reinstalled the OS as suggested in the  manual. I worry if my Mac mini was not due to hard disk probl

  • [SOLVED]T61 new panel: have to change EDID

    Hi Compañeros, I have a very special problem here and i hope, someone could help me fixing it ;-) My Laptops (Lenovo T61 14.1'' SXGA 1400x1050 Intel IGP) Panel broke and i ordered a new one, same modelnumber. I installed it, but the screen stays blac

  • Dead links

    Hi! I hope, I'm now in the right place with the right feedback ;o) The following link contains a page within otn with dead links (the first 3 links are dead, the 4th works fine): http://otn.oracle.com/docs/products/aq/content.html cu ed