OBIEE subtotal Calculation

Hi,
I have a OBIEE pivot table report which shows Projects Information and it has the following fields:
1.Customer
2. Master Project
3. Child Projects under Master project
4.  Task details by Child Project
5.  Contract Hours (this is by Task Details(4)  and Child Project (3))
6.  Total Budget Hours (this is by Task Details(4)  and Child Project (3))
The above 6 columns are included at the pivot table rows section.
In the measures sections, we have following fields
1. Forecast Hours,
2. Actual Hours
Both will be displayed by month as cross tab.
***now the issue is we need to do a subtotal based on Master project which will be a calculation i.e., Total Budget Hours/Contract Hours.
These two field are in the row level and cannot be included in the measures section of the pivot table.
can you please help in this?

Hi,
Here the requirement is to show Subtotal values in the Pivot table on Hierarchy columns (along with other columns also in Pivot table)
Below is the sample table which shows the issue.
When I place Hierarchy column (Region) in Pivot table then "Show Subtotal" option will not comes. But for normal columns I am able to get Subtotal values.
Region (Hierarchy column)
Product Type
Amount(Measure)
Europe
A
100
B
200
Sub Total
300
Asia
A
150
B
250
Sub Total
400
Grand Total
70
Hope this clarifies my issue. Let me know if I get any help.

Similar Messages

  • Problem with subtotal calculation in ALV reports

    Hi All,
       I am doing one program for calculating subtoals in ALV . For this i want to display subtotal text at each envey subtotal 's row.
    For that i have created one form 'SUB_SUBTOT_TEXT' and it has given to IT_EVENTS-FORM. But SUB_SUBTOT_TEXT Form is not called by IT_EVENTS event.
    what are all the mandatories for displaying subtotal text.
    Can any one please help me.
    Thanks in Advance.

    Hi Sree,
    *& Table declaration
    &----TABLES: ekko.&----
    *& Type pool declaration
    TYPE-POOLS: slis. " Type pool for ALV&----
    *& Selection screen
    SELECT-OPTIONS: s_ebeln FOR ekko-ebeln.&----
    *& Type declaration
    &----* Type declaration for internal table to store EKPO data
    TYPES: BEGIN OF x_data,
           ebeln  TYPE char30,  " Document no.
           ebelp  TYPE ebelp,   " Item no
           matnr  TYPE matnr,   " Material no
           matnr1 TYPE matnr,   " Material no
           werks  TYPE werks_d, " Plant
           werks1 TYPE werks_d, " Plant
           ntgew  TYPE entge,   " Net weight
           gewe   TYPE egewe,   " Unit of weight                          
           END OF x_data.&----
    *& Internal table declaration
    DATA:* Internal table to store EKPO data
      i_ekpo TYPE STANDARD TABLE OF x_data INITIAL SIZE 0,
    Internal table for storing field catalog information
      i_fieldcat TYPE slis_t_fieldcat_alv,
    Internal table for Top of Page info. in ALV Display
      i_alv_top_of_page TYPE slis_t_listheader,
    Internal table for ALV Display events
      i_events TYPE slis_t_event,
    Internal table for storing ALV sort information
      i_sort TYPE  slis_t_sortinfo_alv,
      i_event TYPE slis_t_event.&----
    *& Work area declaration
    &----DATA:
      wa_ekko TYPE x_data,
      wa_layout     TYPE slis_layout_alv,
      wa_events         TYPE slis_alv_event,
      wa_sort TYPE slis_sortinfo_alv.&----
    *& Constant declaration
    &----CONSTANTS:
       c_header   TYPE char1
                  VALUE 'H',                    "Header in ALV
       c_item     TYPE char1
                  VALUE 'S'.&----
    *& Start-of-selection event
    &----START-OF-SELECTION.* Select data from ekpo
      SELECT ebeln " Doc no
             ebelp " Item
             matnr " Material
             matnr " Material
             werks " Plant
             werks " Plant
             ntgew " Quantity
             gewei " Unit
             FROM ekpo
             INTO TABLE i_ekpo
             WHERE ebeln IN s_ebeln
             AND ntgew NE '0.00'.  IF sy-subrc = 0.
        SORT i_ekpo BY ebeln ebelp matnr .
      ENDIF.* To build the Page header
      PERFORM sub_build_header.* To prepare field catalog
      PERFORM sub_field_catalog.* Perform to populate the layout structure
      PERFORM sub_populate_layout.* Perform to populate the sort table.
      PERFORM sub_populate_sort.* Perform to populate ALV event
      PERFORM sub_get_event.END-OF-SELECTION.* Perform to display ALV report
      PERFORM sub_alv_report_display.
    *&      Form  sub_build_header
          To build the header
          No Parameter
    FORM sub_build_header .* Local data declaration
      DATA: l_system     TYPE char10 ,          "System id
            l_r_line     TYPE slis_listheader,  "Hold list header
            l_date       TYPE char10,           "Date
            l_time       TYPE char10,           "Time
            l_success_records TYPE i,           "No of success records
            l_title(300) TYPE c.                " Title
    Title  Display
      l_r_line-typ = c_header.               " header
      l_title = 'Test report'(001).
      l_r_line-info = l_title.
      APPEND l_r_line TO i_alv_top_of_page.
      CLEAR l_r_line.* Run date Display
      CLEAR l_date.
      l_r_line-typ  = c_item.                " Item
      WRITE: sy-datum  TO l_date MM/DD/YYYY.
      l_r_line-key = 'Run Date :'(002).
      l_r_line-info = l_date.
      APPEND l_r_line TO i_alv_top_of_page.
      CLEAR: l_r_line,
             l_date.ENDFORM.                    " sub_build_header
    *&      Form  sub_field_catalog
          Build Field Catalog
          No Parameter
    FORM sub_field_catalog .*  Build Field Catalog
      PERFORM sub_fill_alv_field_catalog USING:     '01' '01' 'EBELN' 'I_EKPO' 'L'
         'Doc No'(003) ' ' ' ' ' ' ' ',     '01' '02' 'EBELP' 'I_EKPO' 'L'
         'Item No'(004) 'X' 'X' ' ' ' ',     '01' '03' 'MATNR' 'I_EKPO' 'L'
         'Material No'(005) 'X' 'X' ' ' ' ',     '01' '03' 'MATNR1' 'I_EKPO' 'L'
         'Material No'(005) ' ' ' ' ' ' ' ',
         '01' '04' 'WERKS' 'I_EKPO' 'L'
         'Plant'(006) 'X' 'X' ' ' ' ',     '01' '04' 'WERKS1' 'I_EKPO' 'L'
         'Plant'(006) ' ' ' ' ' ' ' ',     '01' '05' 'NTGEW' 'I_EKPO' 'R'
         'Net Weight'(007) ' ' ' ' 'GEWE' 'I_EKPO'.ENDFORM.                    " sub_field_catalog&----
    *&     Form  sub_fill_alv_field_catalog
    *&     For building Field Catalog
    *&     p_rowpos   Row position
    *&     p_colpos   Col position
    *&     p_fldnam   Fldname
    *&     p_tabnam   Tabname
    *&     p_justif   Justification
    *&     p_seltext  Seltext
    *&     p_out      no out
    *&     p_tech     Technical field
    *&     p_qfield   Quantity field
    *&     p_qtab     Quantity table
    FORM sub_fill_alv_field_catalog  USING  p_rowpos    TYPE sycurow
                                            p_colpos    TYPE sycucol
                                            p_fldnam    TYPE fieldname
                                            p_tabnam    TYPE tabname
                                            p_justif    TYPE char1
                                            p_seltext   TYPE dd03p-scrtext_l
                                            p_out       TYPE char1
                                            p_tech      TYPE char1
                                            p_qfield    TYPE slis_fieldname
                                            p_qtab      TYPE slis_tabname.* Local declaration for field catalog
      DATA: wa_lfl_fcat    TYPE  slis_fieldcat_alv.  wa_lfl_fcat-row_pos        =  p_rowpos.     "Row
      wa_lfl_fcat-col_pos        =  p_colpos.     "Column
      wa_lfl_fcat-fieldname      =  p_fldnam.     "Field Name
      wa_lfl_fcat-tabname        =  p_tabnam.     "Internal Table Name
      wa_lfl_fcat-just           =  p_justif.     "Screen Justified
      wa_lfl_fcat-seltext_l      =  p_seltext.    "Field Text
      wa_lfl_fcat-no_out         =  p_out.        "No output
      wa_lfl_fcat-tech           =  p_tech.       "Technical field
      wa_lfl_fcat-qfieldname     =  p_qfield.     "Quantity unit
      wa_lfl_fcat-qtabname       =  p_qtab .      "Quantity table  IF p_fldnam = 'NTGEW'.
        wa_lfl_fcat-do_sum  = 'X'.
      ENDIF.
      APPEND wa_lfl_fcat TO i_fieldcat.
      CLEAR wa_lfl_fcat.
    ENDFORM.                    " sub_fill_alv_field_catalog&----
    *&      Form  sub_populate_layout
          Populate ALV layout
          No Parameter
    FORM sub_populate_layout .  CLEAR wa_layout.
      wa_layout-colwidth_optimize = 'X'." Optimization of Col widthENDFORM.                    " sub_populate_layout&----
    *&      Form  sub_populate_sort
          Populate ALV sort table
          No Parameter
    FORM sub_populate_sort .* Sort on material
      wa_sort-spos = '01' .
      wa_sort-fieldname = 'MATNR'.
      wa_sort-tabname = 'I_EKPO'.
      wa_sort-up = 'X'.
      wa_sort-subtot = 'X'.
      APPEND wa_sort TO i_sort .
      CLEAR wa_sort.* Sort on plant
      wa_sort-spos = '02'.
      wa_sort-fieldname = 'WERKS'.
      wa_sort-tabname = 'I_EKPO'.
      wa_sort-up = 'X'.
      wa_sort-subtot = 'X'.
      APPEND wa_sort TO i_sort .
      CLEAR wa_sort.
    ENDFORM.                    " sub_populate_sort&----
    *&      Form  sub_get_event
          Get ALV grid event and pass the form name to subtotal_text
          event
          No Parameter
    FORM sub_get_event .
      CONSTANTS : c_formname_subtotal_text TYPE slis_formname VALUE
    'SUBTOTAL_TEXT'.  DATA: l_s_event TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type     = 4
        IMPORTING
          et_events       = i_event
        EXCEPTIONS
          list_type_wrong = 0
          OTHERS          = 0.* Subtotal
      READ TABLE i_event  INTO l_s_event
                        WITH KEY name = slis_ev_subtotal_text.
      IF sy-subrc = 0.
        MOVE c_formname_subtotal_text TO l_s_event-form.
        MODIFY i_event FROM l_s_event INDEX sy-tabix.
      ENDIF.ENDFORM.                    " sub_get_event&----
    *&      Form  sub_alv_report_display
          For ALV Report Display
          No Parameter
    FORM sub_alv_report_display .
      DATA: l_repid TYPE syrepid .
      l_repid = sy-repid .* This function module for displaying the ALV report
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = l_repid
          i_callback_top_of_page   = 'SUB_ALV_TOP_OF_PAGE'
          is_layout                = wa_layout
          it_fieldcat              = i_fieldcat
          it_sort = i_sort
          it_events                = i_event
          i_default                = 'X'
          i_save                   = 'A'
        TABLES
          t_outtab                 = i_ekpo
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
      IF sy-subrc <> 0.
       MESSAGE i000 WITH 'Error in ALV report display'(055).
      ENDIF.ENDFORM.                    " sub_alv_report_display&----
          FORM sub_alv_top_of_page
          Call ALV top of page
          No parameter
    ----FORM sub_alv_top_of_page.                                   "#EC CALLED* To write header for the ALV
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = i_alv_top_of_page.
    ENDFORM.                    "alv_top_of_page&----
    *&      Form  subtotal_text
          Build subtotal text
          P_total  Total
          p_subtot_text Subtotal text info
    FORM subtotal_text CHANGING
                   p_total TYPE any
                   p_subtot_text TYPE slis_subtot_text.
    Material level sub total
      IF p_subtot_text-criteria = 'MATNR'.
        p_subtot_text-display_text_for_subtotal
        = 'Material level total'(009).
      ENDIF.* Plant level sub total
      IF p_subtot_text-criteria = 'WERKS'.
        p_subtot_text-display_text_for_subtotal = 'Plant level total'(010).
      ENDIF.
    ENDFORM.                    "subtotal_text
    Hopes its helpful.
    Regards,
    Raj.

  • Alv subtotal calculation

    hi gurus,
    my query is :
    i have to calculate rate per min , p3 =  p1/p2 in subtotal column.but in the scenario given below it is just adding all the rpm and giving the total = 0.56 ,
    but -3612/13940 = 0.26 is correct.
    EX:
      amt(P1)     minutes (p2)   rpm(rate per min)(p3)
    9,500.00-       5233             1.82-
    1,500.00        3235              0.46
    4,388.00        5472              0.80
    3,612.00-      13940              0.56-   -
    subtotal of above rows
    so i want the subtotal value of p3 as p1/p2  and not just sum
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Apr 21, 2008 5:47 PM

    This you can do using the Subtotal_text event of alv.
    Check the sample code below..
    in the event you will have the SUB TOTAL ROW INFORMATION, now divide the P1/P2  and get the P3 value.
    modify the P3 value with value calculated , this will show the Changed value.
    For information:-
    you can find 2 programs one using class, one using Grid Function.
    Re: SubTotal Text in ALV?

  • Subtotal calculation display in ALV report

    hi,
    i had made a report n alv which is almost complete but i want to add the feature that when i click on a field when output is displayed den the subtotal of all qty fields should be shown also.
    plz provide me with useful example as i am using the concept of INTERNAL TABLES.
    plzz reply fast as it is important to me and definately rewarded.

    Hi ric,
    check out this code.
    *& Report  ZST_ALV
    REPORT  ZST_ALV.
    type-POOLs: slis.
    --ALV Related Variables--
    DATA: lt_fcat          TYPE slis_t_fieldcat_alv,
          lw_fcat          TYPE slis_fieldcat_alv,
          lv_variant       TYPE disvariant,
          lv_layout        TYPE slis_layout_alv,
          lt_sort          type slis_t_sortinfo_alv,
          lw_sort          type slis_sortinfo_alv.
    types: begin of ty_vbap,
           vbeln type vbap-vbeln,
           posnr type vbap-posnr,
           zmeng type vbap-zmeng,
           end  of ty_vbap.
    data: lt_vbap type table of ty_vbap.
    start-of-selection.
    select vbeln posnr zmeng
           from  vbap
           into  table lt_vbap.
    sort lt_vbap descending.
    clear lw_fcat.
    lw_fcat-fieldname = 'VBELN'.
    lw_fcat-seltext_l = 'Sales document'.
    append lw_fcat to lt_fcat.
    clear lw_fcat.
    lw_fcat-fieldname = 'POSNR'.
    lw_fcat-seltext_l = 'Sales document'.
    append lw_fcat to lt_fcat.
    clear lw_fcat.
    lw_fcat-fieldname = 'ZMENG'.
    lw_fcat-seltext_l = 'Sales document'.
    lw_fcat-do_sum = 'X'.
    append lw_fcat to lt_fcat.
    lw_sort-spos = 1.
    lw_sort-fieldname = 'VBELN'.
    LW_SORT-Up = 'X'.
    append lw_sort to lt_sort.
    clear lw_sort.
    lw_sort-spos = 3.
    lw_sort-fieldname = 'ZMENG'.
    LW_SORT-Up = 'X'.
    lw_sort-subtot = 'X'.
    append lw_sort to lt_sort.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
      I_CALLBACK_PROGRAM                = ' '
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
      I_CALLBACK_TOP_OF_PAGE            = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         =
       IT_FIELDCAT                       = lt_fcat[]
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
       IT_SORT                           = lt_sort[]
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        T_OUTTAB                          = lt_vbap
    EXCEPTIONS
       PROGRAM_ERROR                     = 1
       OTHERS                            = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    regards,
    Santosh Thorat

  • OBIEE 11G Calculation the Correct Way

    Hi All,
    My requirement is like this that I want to calculate value Gross Profit which is simple Total Revenue - Total Expense. Now I want this to act as a Hierarchy i.e Gross Profit should be drill able to Total Revenue followed by Total Expenses. For this I created a Accounts Dimension table since no Drill Down facility is available on Fact Table(Therefore I had to move my Accounts to Dimension table rather than Fact Table). Now the problem is that there is no minus based aggregation present in OBIEE BMM layer because of which my all other sum based aggregation work correctly except where there is a negative based aggregation required like in the case of Gross Profit. Kindly Suggest what is the correct way to approach this problem. I am working on OBIEE 11g in this case.
    Warm Regards
    Abhishek Kapoor

    Financial reporting is difficult in BI because of the user preference of how to see signs on different accounts and requirements for adding/subtracting depending on the type of account.
    A few ways to approach:
    a. Use case statement to make total rev and total expense columns. Subtract to build a gross profit column. You can do this in the presentation services front end or the BMM.
    b. If you have opposite natural signs for rev and exp, you can create an account hierarchy in the account table which will net out to gross profit. Ex:
    Column 1 – account number
    Column 2 – hierarchy level 1, ex Gross Profit
    Column 3 – hierarchy level 2, ex Rev or exp
    Column 4 – account name
    Etc…
    c. Remember you can always build your own drilldown using navigation links to a report instead of the built-in drilldown.
    Good luck!

  • OBIEE 11g Calculated column problem

    Hi Gurus,
    I want to convert to below condition to obiee.
    Database Condition like below:
    ZEROIFNULL(CAST((CAST(COUNT(CASE WHEN END_output<=.033 and END_output>='-.117' THEN END_output END) AS FLOAT)/
    CAST(NULLIFZERO (COUNT(In_PUT)) AS FLOAT)) AS DECIMAL(10,1)))*100 AS Real_Time
    In Database output is = 48
    I have converted to OBIEE like below.
    IFNULL( CAST ( COUNT(CASE WHEN "- Order Fact"."END_output" <= .033 and "- Order Fact"."END_output" >='-.117' THEN "- Order Fact"."END_output" END) AS FLOAT ), 0) / CAST(IFNULL (COUNT("- Sales Fact"."In_PUT"),0) AS FLOAT ) *100
    In OBIEE output is = 45
    Note: I am getting two or three count difference in OBIEE.
    I guess the problems is Decimal, how to apply decimal in obiee like (DECIMAL(10,1)))..
    Please help on this.
    Thanks

    user12301120 wrote:
    Hi Gurus,
    I want to convert to below condition to obiee.
    Database Condition like below:
    ZEROIFNULL(CAST((CAST(COUNT(CASE WHEN END_output<=.033 and END_output>='-.117' THEN END_output END) AS FLOAT)/
    CAST(NULLIFZERO (COUNT(In_PUT)) AS FLOAT)) AS DECIMAL(10,1)))*100 AS Real_Time
    In Database output is = 48
    I have converted to OBIEE like below.
    IFNULL( CAST ( COUNT(CASE WHEN "- Order Fact"."END_output" <= .033 and "- Order Fact"."END_output" >='-.117' THEN "- Order Fact"."END_output" END) AS FLOAT ), 0) / CAST(IFNULL (COUNT("- Sales Fact"."In_PUT"),0) AS FLOAT ) *100
    In OBIEE output is = 45
    Note: I am getting two or three count difference in OBIEE.
    I guess the problems is Decimal, how to apply decimal in obiee like (DECIMAL(10,1)))..
    Please help on this.
    ThanksTry multiplying by 100.0 instead of 100

  • Subtotal calculation in ALV

    hi all,
    i need to calculate montly subtotal value of a field  in ALV ( OO),
    how can i do that.
    plz send the code also.
    thanks in advance.
    regards
    sushant  singh

    Hi,
    1) Create a sort internal table for you to do sub totaling based on the field change..In this example..I have created a sort internal table and it will sum for every change in the field VBELN.
    data: gs_sort     type lvc_s_sort.
    data: gt_sort     type lvc_t_sort.
      gs_sort-fieldname = 'VBELN'.
      gs_sort-UP          = 'X'.
      gs_sort-SUBTOT  = 'X'.
      append gs_sort to gt_sort.
    Pass the internal table GT_SORT to the parameter                   
    it_sort = gt_sort
    of the method set_table_for_first_display..
    2) For the field you have to do sum in the field catalog have the field DO_SUM = 'X'..
    Thanks,
    Naren

  • ALV: conditional total / subtotal calculation

    Dear colleagues,
    I am using the REUSE_ALV_GRID_DISPLAY_LVC function. My ALV has character columns only. There are 5 key columns and up to 120 day columns (one per day). The day columns containing "real character" values or blank. Does anybody know if it is possible to implement the following requirement? And if yes, how?
    The toolbar should contain the total and subtotal button. When (i.e.) the subtotal button is pressed, for every day column the number of cells containing "real characters" (not blank only) should be displayed grouped by the marked key col. ?
    Thank you for your help,
    Peter

    Hi,
    You need to have an field which is an integer type i.e. type i in the structure and make the subtotal as 'X' in the Field layout.
    Thanks & Regards
    Sarves Sombhatla

  • Custom OBIEE Subtotal and Total Font Size

    Hello all
    Im trying to customize the font size of the subtotal or total row
    I was able to find the following and it got me half way there
    http://obieexpertise.blogspot.ca/2010/05/customize-format-of-subtotal-cells.html
    BUT the issue I have now is that while the the total values are now increased in font size, the name of the row is not increased
    So for example
    Change Total 1000
    The 1000 has increased in font size, but how do i get the "Change total" to increase in size?
    Edited by: chillychin on May 9, 2013 2:02 PM

    In Pivot table Rows section on column->Sigma icon->Format Labels... or Format Values
    are not helping you?
    The same for Table view too, this would be simplest one.
    Edited by: Srini VEERAVALLI on May 9, 2013 4:11 PM
    If you update your older posts that helps you to fetch answers for new posts
    Edited by: Srini VEERAVALLI on May 15, 2013 9:43 AM

  • Subtotal Calculation

    Is there any way to show the subtotals in front of the section cell, not at the end of section. I have a section within a section. Clients want subtotals in front of both section cells. I have over thirty columns in my report and three of them are measures. I think I should insert a free standing cell in front of the section cell and use the ForEach() function. Do you think it will work:
    =[Dimension]ForEach[Measure]

    You can insert the formula inside each section. Make sure that for the top section you are putting in the First section and calculation for the Second section should e in the Second Section.
    Use the Formula =Sum ([Measure]) In Section

  • Calculating subtotal in table control

    Hi all my requrement is like this
    I am using one tabbed screen .
    in the last tabbed screen i have used table control in that
    screen there is one requirement so that to  calculate the subtotal as we can do in case of alv reporting by using the subtotal button .
    can anybody help me how to do this .

    HI,
    subtotal_text
    Use
    Output text for subtotals in the grid control if the subtotal criterion (column used by the user for calculating the subtotal) is hidden. In the default setting, the ALV Grid Control outputs the column header of the subtotal criterion and the value to which the subtotal calculated refers.
    Event parameters
    Meaning
    ES_SUBTOTTXT_INFO
    Type LVC_S_STXT
    Structure with information on the subtotal criterion
    EP_SUBTOT_LINE
    Type Ref To DATA
    Reference variable to the inserted subtotal line in the grid control. Columns for which no total was calculated remain set to their initial value.
    E_EVENT_DATA
    Type Ref To CL_ALV_EVENT_DATA
    Attribute M_DATA of this object is a reference to the subtotal text.
    For an overview, see: Events of Class CL_GUI_ALV_GRID
    Example
    You display a table with data of structure SFLIGHT in an ALV Grid Control. We now change the pre-set subtotal text for subtotal criterion plane type of table SFLIGHT :
    Define and implement an event handler method for event subtotal_text . Register this event with SET HANDLER .
    Call a subroutine within this method and pass the event parameters to that subroutine.
    Event parameters ep_subtot_line and e_event_data contain reference variables to generic data type DATA . This is why you must use field symbols in the subroutine:
    FORM method_subtotal_text USING es_subtottxt_info TYPE lvc_s_stxt
                                   ep_subtot_line TYPE REF TO data
                                   e_event_data TYPE REF TO
                                   cl_alv_event_data.
      DATA ls_sflight LIKE sflight.
      FIELD-SYMBOLS: <fs1> STRUCTURE sflight DEFAULT ls_sflight,
                    <fs2>.
      IF es_subtottxt_info-criteria = 'PLANETYPE'.
        ASSIGN ep_subtot_line->* TO <fs1>.
        ASSIGN e_event_data->m_data->* TO <fs2>.
        CONCATENATE es_subtottxt_info-keyword ': '
                    <fs1>-planetype INTO <fs2>.
      ENDIF.
    ENDFORM. " METHOD_SUBTOTAL_TEXT
    Result
    Check your result as follows:
    Calculate the total for a column.
    Calculate subtotals for column plane type .
    Hide column plane type . To do this, use either the standard context menu or a new layout.
    The new text defined is displayed at the beginning of a subtotal line.

  • Row Based Calculations - Pivot Table

    Hi,
    Can anyone help with creating calculating items in a pivot table. I have been following this example:
    http://obiee101.blogspot.com/2009/01/obiee-rowbased-calculations-in-pivot.html
    I have created a calculation item on the column of my pivot table(month_name), only selecting Sep & Oct:
    Function: Formula
    (Sep+Oct)
    This returns 1 for all rows in the pivot table, these months do contain numeric values and there is a page item based on year.
    Can anyone help?
    Thanks

    Hi,
    Lets consider you are having only 3 columns.
    One in rows,other in columns(your month column and measure column in measures section.Then if you re using Calculated item in column section ie. on your month column,writing a formula as (Oct-06)+(Nov-06)+(Dec-06) with Name Grand Total.It will return only one column Grand Total with sum of all the months you gave across the rows.
    Regards,
    Srikanth

  • Subtotal after filtering data

    I have a spreadsheet of approximately 2,500 rows. Each row is one expense incurred since about last September. What I'd like to do is categorize the data across the cost centers (one column) then filter them for the current quarter (a date value in another column).
    If I use the subtotal calculation in the category header row, I get the subtotal for the entire category, not the category filtered for the date range.
    Any thoughts?

    Hi Doug,
    The categorize feature of Numbers 09 tables is basically a viewer with some nice features, but with limited utility beyond viewing.
    My preference would be to use SUMIFS expression(s) to get just the summary I want, in a separate table where I can make Charts, do comparisons, etc. If you need some guidance setting that up, there is a Numbers User Guide and a iWork Formulas and Functions User Guide, both available from the Help menu. Plus, it's rather frequent question here, so the discussions search function should return many examples. You'll find that SUMIFS is very powerful and should do just what you need.
    My thoughts,
    Jerry

  • How to use aggregation -Average using a class

    Hi Gurus,
       In my report i have used cl_salv_table  and for event i have used cl_salv_events_table, now i want to calculate average for some of the fields as such subtotal calculation . In my normal alv reports i have used the class lcl_event_receiver also, but for the report which iam using a class , i d'not know how to compain both the class  (i.e) cl_salv_table, class lcl_event_receiver. Help me to solve the problem.

    cancelled

  • How to calculate the subtotals in smartform

    hi all
    can any body tell me how can i display teh subtotals in smartform, please tell me the steps how to do that and aslo is there any special events in smartforms that are helpfull in getting and displaying the subtotals in smartforms
    thanks in advance

    Hi,
    For doing subtotal calculation in SMARTFORMS, do like this.
    Create one "Program Lines" to your main window table row.
    Already you are maintaing "Internal table" for you table in main window.
    Before that, sort the particular internal table with key fields through which you want to find out the sub total, now within the program lines code, first identify how many quantity and currency fields are there.
    Declare respective temporary variables for each and every quantity and currency field.
    then write logic like this.
    at new matnr.
    v_menge = wa_out-menge + v_menge.
    v_netwr  = wa_out-netwr + v_netwr
    end at.
    Also dont forget to declare character variables for quantity and currency fields. We cannot directly display them in smartforms. we need to pass them to the respective quantity and currency fields.
    After end at statement write like this,
    write: / v_menge decimals 2 to v_mengetext,
              v_netwr   decimals 2 to v_netwrtext.
    after this dont forget to clear,
    clear: v_menge, v_netwr.
    no populate v_mengetext and v_netwrtext in your text elements.
    Regards,
    Santosh Kumar M.

Maybe you are looking for