Grands totals for % Columns coming incorrect in pivot view .

Hello ,
I have the below scenario . Iam trying to get the calculated grand total for % column . I tired several ways ...like report aggregates enabled in instanceconfig,tried creating cal colum using physical columns as well as logical columns in RPD , changing the aggregation rule. The row wise values (%) are coming correct but iam unable to get correct % grand total (36.8%) instead iam just getting the sum of the % total ( 83.3%) . I have tried the above options in my previous reports and those conditions work perfectly right but for this report they are not able to . kindly please let me know if anybody has a solution for this issue .
Department ...USD CAD Variance (USD/CAD)*100
XYZ 10 20 50%
ABC 25 75 33.3%
Total 35 95 36.8% ( 35/95)
Thanks
Karthik

Just to cross check
Do you have following tag in your instanceconfig file ? if its not there then you may encounter grand total incorrect calculations.
<ReportAggregateEnabled>true</ReportAggregateEnabled>

Similar Messages

  • Grand Totals for GOURL columns

    We are having an issue showing Grand Totals for GOURL enabled columns
    We have enabled GOURL on the amount columns, To enable hyperlink we had to convert the the number column to character. Enabling the Grand total in the Table View is thorwing error "Function Report_Sum does not support non-numeric types".
    Any input on the above would be of great help.
    We are using OBIEE version 10.1.3.4
    Thanks
    Kranthi

    You can try the following..
    1) Keep the same name for all the amount fields in each column. (for example, first amount column field name is "Amount1" and second column field name is "Amount2").
    2) Then write the code in the Calculate event of the Total field. (Use FormCalc)
         Total1.rawValue = Sum(Table1.Row1[*].Amount1);
    3) Similarly for Second column
         Total2.rawValue = Sum(Table1.Row1[*].Amount2);
    4) For the total of Amount1 and Amount2.
         LoanTotal = Sum(Total1.rawValue + Total2.rawValue);
    Hope this helps.
    Thanks
    Srini

  • Alv subtotals  and grand total for a field

    Hi friends,
    I Have an internal table ITAB1
    in that i have a senario as below.
    In my GRID display iam getting values in the layou as follows
    BUKRS =  1000
    LIFNR      MATNR     STCST
    100          abc            500,00
    100          pqr             400,00
    100          xyz            200,00
                        sub total
    200         pto              700,00
    200         vbr              900,00
                        sub total
    BUKRS =  2000
    LIFNR      MATNR     STCST
    150          abc            500,00
    150          pqr             400,00
    150          xyz            200,00
                        sub total
    260         pto              700,00
    260         vbr              900,00
                        sub total
              GRAND TOTAL = 
    Now my requirement is at the end of every vendor  i need sub total for STCST field.
    and at the end of every company code i need GRAND TOTAL for STCST field.
    Its alv grid display.
    how can i do that.
    Regards,
    Priyanka.

    Check this sample code may it will help u:
    *& Report  Z_ALV_SUBTOTAL
    REPORT z_alv_subtotal.
    *& 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 width
    ENDFORM.                    " 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
    Edited by: Joyjit Ghosh on Aug 21, 2008 5:25 PM

  • I need the grand total for particular coulumn for ALV grid report(OOPs).

    Hello,
    I have used the following code,
    But i m not getting the grand total by default.No error but not getting the desired result.
    Could you please help me in this regard.
    FORM  display_simple_alv.
      DATA :  lr_msg  TYPE   REF   TO  cx_salv_msg.
      DATA : lv_header   TYPE   REF   TO  cl_salv_form_layout_grid,
             lv_h_label  TYPE   REF   TO  cl_salv_form_label,
             lv_h_flow   TYPE   REF   TO  cl_salv_form_layout_flow.
      DATA: gr_sorts TYPE REF TO cl_salv_sorts.
      DATA: gr_agg TYPE REF TO cl_salv_aggregations.
      TRY .
          cl_salv_table=>factory(  IMPORTING  r_salv_table = gr_salv_table
                                   CHANGING  t_table = gt_invdetails4 ).
        CATCH  cx_salv_msg  INTO  lr_msg.
      ENDTRY  .
    Display Basic Toolbar
      gr_functions = gr_salv_table->get_functions( ).
      gr_functions->set_all( abap_true ).
      TRY .
          gr_columns = gr_salv_table->get_columns(  ).
          gr_columns->set_optimize( ).
        CATCH  cx_salv_not_found.
      ENDTRY .
      TRY .
          gr_column ?= gr_columns->get_column(  'KUNNR'  ).
          gr_column->set_long_text(  text-009 ).
          gr_column->set_medium_text(  text-009 ).
          gr_column->set_short_text(  text-009 ).
          gr_column ?= gr_columns->get_column(  'NAME1'  ).
          gr_column->set_long_text(  text-010 ).
          gr_column->set_medium_text(  text-010 ).
          gr_column->set_short_text(  text-011 ).
          gr_column ?= gr_columns->get_column(  'AMOUNT'  ).
          gr_column->set_long_text(  text-012 ).
          gr_column->set_medium_text(  text-012 ).
          gr_column->set_short_text(  text-012 ).
          gr_column ?= gr_columns->get_column(  'TAX'  ).
          gr_column->set_long_text(  text-013 ).
          gr_column->set_medium_text(  text-013 ).
          gr_column->set_short_text(  text-013 ).
          gr_column ?= gr_columns->get_column(  'IVA'  ).
          gr_column->set_long_text(  text-014 ).
          gr_column->set_medium_text(  text-014 ).
          gr_column->set_short_text(  text-015 ).
          gr_column ?= gr_columns->get_column(  'TOTAL_AMOUNT'  ).
          gr_column->set_long_text(  text-016 ).
          gr_column->set_medium_text(  text-016 ).
          gr_column->set_short_text(  text-017 ).
          gr_column ?= gr_columns->get_column(  'CURRENCY'  ).
          gr_column->set_long_text(  text-018 ).
          gr_column->set_medium_text(  text-018 ).
          gr_column->set_short_text(  text-018 ).
          gr_column ?= gr_columns->get_column(  'ZINTERNAL_REFNO'  ).
          gr_column->set_long_text(  text-019 ).
          gr_column->set_medium_text(  text-019 ).
          gr_column->set_short_text(  text-019 ).
          gr_column ?= gr_columns->get_column(  'MATERIAL_AMOUNT'  ).
          gr_column->set_long_text(  text-020 ).
          gr_column->set_medium_text(  text-020 ).
          gr_column->set_short_text(  text-021 ).
          gr_column ?= gr_columns->get_column(  'LABOUR_VALUE'  ).
          gr_column->set_long_text(  text-022 ).
          gr_column->set_medium_text(  text-022 ).
          gr_column->set_short_text(  text-023 ).
          gr_column ?= gr_columns->get_column(  'FAILURE_COST'  ).
          gr_column->set_long_text(  text-024 ).
          gr_column->set_medium_text(  text-024 ).
          gr_column->set_short_text(  text-021 ).
          gr_sorts = gr_salv_table->get_sorts( ).
          gr_sorts->add_sort( columnname = 'AMOUNT' subtotal = abap_true ). "for subtotal
          gr_agg = gr_salv_table->get_aggregations( ).
          gr_agg->add_aggregation( 'AMOUNT' ).
        CATCH  cx_salv_not_found cx_salv_data_error cx_salv_existing.
      ENDTRY .
    Set top of page
      CREATE OBJECT lv_header.
      lv_h_label = lv_header->create_label( row =  1  column =  1  ).
      lv_h_label->set_text(  text-001  ).
      lv_h_label = lv_header->create_label( row =  1  column = 5  ).
      lv_h_label->set_text(  text-002  ).
      lv_h_label = lv_header->create_label( row =  1  column = 14  ).
      lv_h_label->set_text(  text-003  ).
      lv_h_flow = lv_header->create_flow( row =  3  column =  04  ).
      lv_h_flow->create_text(  text  =  text-004  ).
      lv_h_flow = lv_header->create_flow( row =  3  column =  05  ).
      lv_h_flow->create_text(  text  =  text-005  ).
      lv_h_flow = lv_header->create_flow( row =  3  column =  06  ).
      lv_h_flow->create_text(  text  =  name  ).
      set the top of list using the header for Online.
      gr_salv_table->set_top_of_list( lv_header ).
    ALV Display
      gr_salv_table->display( ).
    ENDFORM .                     " DISPLAY_SIMPLE_ALV

    Hi Sridevi,
    To get the grand total, you need to pass the SORT itab to the function module. You need to populate the internal table with the fields on which you want the total or subtotal. If you donu2019t pass this table, you wonu2019t get it.
    For ex:
       ls_sort_wa-spos = 1.
      ls_sort_wa-fieldname = gs_plant-werks.
      ls_sort_wa-up = 'X'.
      ls_sort_wa-subtot = 'X'.
      APPEND ls_sort_wa TO gt_sort.
    So the above code, gives the sub total plant wise.
    and if you want the sum(grand total) you can set the DO_SUM to u2018Xu2019 for that particular field in the field catalog.
    So with this approach, you can get the sub total and grand total for a particular field.
    If you donu2019t want the subtotal, just set DO_SUM, you will get the total.
    Thanks,
    Srini.

  • Grand total for user

    Hello,
    Using obiee 11g,
    I am trying to build a report where i am trying do a count(distinct un),so i created a logical column for that and using that in my answers.
    The un i am showing for over months.IS works fine except that the grand total shows wrong.
    Grand total just adds the months total and not just do a count distinct for un.
    Aggregation rule is set as default.
    Would like to know how to do this?
    Thanks

    Hello,
    Its not working that way.
    Let me explain my case in detail.Problem is only in case of GRAND TOTAl.
    I am showing different cases,users and export for each month.
    So cases and users are used everywhere so i created a logical column in the RPD.
    count(distinct caseid) and count(distinct userid) as cid and uid and using that in my answers.
    export count since not used everywhere initially i took that column into my answers and then did a count(xportcount) in my answers
    so i have now
    cid-uid-count(xportcount) as 3 columns in my answers.But here the problem is my Grand total for uid comes wrong.
    Instead of doing a distinct users for all the months selected it just shows the grand total as sum for users
    Like jan-16 users feb -17 users then the total is 16+17 and not the distinct users from jan and feb.
    Grand total for case and exportcount is correct because i need a sum in that case so aggregation rule as deault works fine here.
    Here the problem which i feel is the count distinct which i am doing for caseid and uid and not exportcount.
    In my second scenario i did like created a separted column count(exportcount) in the rpd, then used that in my answers.
    But still no use
    In my third sceanario i created a count(distinct exportcount) in the rpd and using that in my answers
    now it feels it works fine.
    I wnat to know is this the way BI works.
    I am bit confused now.
    Is there a way other then this to do.
    I wanted first,second sceanario also to work but doesnt feel like working is there a way to make it work?
    Thanks

  • CurrencyFormatter and grand total of column

    Hey everyone,
    I think I have have two bug’s or arror in my code, with the folowing application
    The grand total of column Cost does not execute with creationComplete but I have to call it throu the button
    And whean I clik in a row of Cost column and clik away the amound gets two extra digits, it has to do with precision="2" of the CurrencyFormatter dut how do I keep the format and not the dug.
    Thanks in advance,
    Dimitris Orlandos.
     <?xml version="1.0" encoding="utf-8"?>
    <mx:Application  creationComplete="loadData()" styleName="plain" xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" height="376" xmlns:ordersopenservice="services.ordersopenservice.*">
          <mx:Script>
                <![CDATA[
                      import mx.events.FlexEvent;
                      import mx.controls.Alert;
                      import mx.collections.ArrayCollection;
    private function loadData():void
                      calculateTotalColumn();
                      initApp();
    private function initApp():void
                      dataGrid.dataProvider = new ArrayCollection([
                        {Type:'Normal', Desc:'Normal 20/20', Cost:0},
                        {Type:'None', Desc:'Player has no optical receptors', Cost:-2},
                        {Type:'Enhanced', Desc:'Enhanced Vision', Cost:5},
                        {Type:'Infrared', Desc:'Player can see heat sources', Cost:5}
    public function formatPrice(item:Object, column:DataGridColumn):String
                            var returnValue:String = setCurrencyFormat.format(item.Cost);
                            return returnValue;
                                 [Bindable]
                                 private var totalColumn:Number = 0;
                                 private function calculateTotalColumn():void
                                       for each (var row:Object in dataGrid.dataProvider)
                                 totalColumn += Number(row.Cost);
                ]]>
        </mx:Script>
         <mx:CurrencyFormatter id="setCurrencyFormat" precision="2" rounding="none" decimalSeparatorTo=","
          thousandsSeparatorTo="." useThousandsSeparator="true" useNegativeSign="true" currencySymbol="€" alignSymbol="left"/>
          <mx:Text text="{setCurrencyFormat.format(totalColumn)}" x="363" y="240" height="35"  fontWeight="bold" fontSize="16" id="text1" fontFamily="Eurostile" width="77" />
          <mx:Button id="b1"
                  label="calculate"
                  click="calculateTotalColumn()"
               x="352" y="298" />
          <mx:DataGrid id="dataGrid" editable="true" width="348" height="205" x="22" y="10">
              <mx:columns>
                  <mx:DataGridColumn dataField="Type"/>
                  <mx:DataGridColumn dataField="Desc"/>
                  <mx:DataGridColumn dataField="Cost" labelFunction="formatPrice"/>
              </mx:columns>   
          </mx:DataGrid>
    </mx:Application>
       

    For everyone interested, this is my work around.
    If there is a better way please let me know
    private function calculateTotalColumn(evt:CollectionEvent):void
           var totalColumn:Number = 0;
           for each (var row:Object in OrdersOpenDataGrid.dataProvider)
                 totalColumn += Number(row.total_price);
           text1.text = setCurrencyFormat.format(totalColumn.toFixed(2));
    <mx:CurrencyFormatter id="setCurrencyFormat" useNegativeSign="true" currencySymbol="€" alignSymbol="left"/>

  • Subtotal and grand total for two fields(iseg-buchm and iseg-erfmg)

    hi experts,
        how to do subtotal and grand total for two fields (iseg-buchm and iseg-erfmg).please help me on solving the problem.

    subtotal & grand total can be done in folowing way in ALV.
    1.Pass it_sort parametere to REUSE_ALV_GRID_DISPLAY
    2.Give the field name for sorting in it_sort-fieldname. it can be any field name  u want to sort ur data with.
    3.For iseg-buchm & iseg-erfmg mark do_sum = 'X'. in fieldcat
      gs_sort-spos = 1.
      gs_sort-fieldname = 'ANY FIELD NAME'.
      gs_sort-up = 'X'.
      gs_sort-subtot = 'X'.
      APPEND gs_sort TO et_sort.
      IF iv_fieldname = 'BUCHM'
      OR iv_fieldname = 'ERFMG'.
        gs_fieldcat-do_sum = 'X'.
      ENDIF.
      APPEND gs_fieldcat TO gt_fieldcat.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
           is_variant              = ev_variant
          it_fieldcat             = gt_fieldcat[]

  • When Requested for a Grand Total the column values changes to zeroes

    Hi,
    I have a report with 2 dimensions and 4 facts. The report is showing the correct data when compared with EBS, but when we are applying grand total in Table View then for fact values are displaying zeroes. However the grand total is correct but for some dimensions the measures are displaying zeroes.
    At this point i have modified the Aggregation rule of 1 measure from Default to SUM and when i clicked results Wonder, i can see grand total and the zeroes were replaced with actual values. When i have compared logical queries before applying the aggregation and after, the measure is surrounded with function REPORT_AGGREGATE and REPORT_SUM respectively.
    Can anyone explain me why is this behavior occurred, i got the solution but i am not in stage to explain to client why it happened.
    Kindly help and i will make sure it is definitely marked.

    Re:  Bottom Line Grand Total
    Use the Subtotal function instead of the Sum function for all totals.
    The Subtotal function ignores other Subtotal functions in the column you are summing.
    Your three "Sum" functions would look something like...
    =SUBTOTAL(9,J3:J7)    '300
    =SUBTOTAL(9,J8:J14)  '900
    =SUBTOTAL(9,J3:J14)  '1200
    '--- Info
    1    AVERAGE
    2    COUNT
    3    COUNTA
    4    MAX
    5    MIN
    6    PRODUCT
    7    STDEV
    8    STDEVP
    9    SUM
    10    VAR
    11    VARP
    Jim Cone
    Portland, Oregon USA
    free and commercial excel programs at...
    https://jumpshare.com/b/O5FC6LaBQ6U3UPXjOmX2

  • OAF :I need to show totals for columns that breaks on one of the column in Advance Table

    I am using advance table (AT),
    I have a requirement to calculate totals for few columns in the AT, based on the account number ( totals should break on the account # , as shown below )
    Please help.
    Account
    Desc
    Paid Amt
    AP Credit
    acc1
    desc1
    200
    100
    acc1
    desc1
    300
    100
    acc1
    desc1
    400
    100
    Total 900
    Total 300
    acc2
    desc2
    150
    50
    acc2
    desc2
    250
    50
    acc2
    desc2
    100
    150
    Total 500
    Total 200
    Message was edited by: 85de445e-a75a-4f2f-b086-8cb6abb09c5d
    CAN ANY ONE PLEASE PROVIDE ANY INPUTS.. , AS ITS URGENT ! Thanks in advance.

    Any updates on this please !!! ?
    Please suggest if this can be achieved by any other region type or any specific type to be used ??

  • Showing column header in obiee pivot view

    Hi,
    I have a requirment where I need to display column heading in pivot view.
    Some thing like below;
    *(col Head)* AUD GBP
    *(Col Head)* 16/12/2011 16/12/2011
    Open Bal 230 450
    Close Bal 300 800
    xxxx xx ..
    yyy
    dd
    In the Place of (col Head) I need to get column heading of(AUD and Date) in pivot view.
    Can anyone please help with it.
    Thanks,
    Ash

    my report looks like below:
    _(col name of AUD)_________________|_______AUD______________|________USD_______
    _(Col Name of 18/12/2011)__________ |_____18/12/2011__________|______18/12/2011____
    Open Bal 130 180
    Close Bal 140 190
    in the pivot view:
    Row Section: Measure Labels
    Columns Section: Currency, Date
    Measures: Open Bal, Close Bal etc... Columns

  • Grand Total For Matrix Based Report

    Hi All,
    I have a matrix based report with Fields like Country ,Amount and MonthYear
    So report looks like below the columns get generated dynamically :
    Country     Oct 2013    Nov 2013  Dec 2013
    India         25,000         25,000    25,000
    England    22,000         25,000    30,000
    Total         57,000         50,000    55,000
    So this works perfectly fine . So next step was to get difference between the months like below :
    Country     Oct 2013    Nov 2013  Dec 2013   Oct-Nov 2013          Nov - Dec 2013
    India         25,000         25,000    25,000             0                              
    0
    England    22,000         25,000    30,000          -3000                      
    -5000
    Total         57,000         50,000    55,000
    Simon_Hou Provided me a custom code for dynamically find the difference between months . Now only requirement left is the sum of the dynamically generated month difference column . As the columns are generated based on a custom code it's not allowing me
    to do a sum  on it.
    Desired Output
    Country     Oct 2013    Nov 2013  Dec 2013   Oct-Nov 2013          Nov - Dec 2013
    India         25,000         25,000    25,000             0                              
    0
    England    22,000         25,000    30,000          -3000                      
    -5000
    Total         57,000         50,000    55,000         -3000                       
    -5000
    Can any one please advice me how to do sum for the dynamically generated custom code column .
    Code is below it might help some1 else(Simon_Hou)
    Private queueLength As Integer = 2
    Private queueSum As Double = 0
    Private queueFull As Boolean = False
    Private idChange As String=""
    Dim queue As New System.Collections.Generic.Queue(Of Integer)
    Public Function CumulativeQueue(ByVal currentValue As Integer,id As String) As Object
    Dim removedValue As Double = 0
    If idChange <> id then
            ClearQueue()
                    idChange = id 
                    queueSum = 0 
                    queueFull = False
                    CumulativeQueue(currentValue,id)
    Else  
                    If queue.Count >= queueLength Then
                                    removedValue = queue.Dequeue()
                    End If
                    queueSum += currentValue
                    queueSum -= removedValue
                    queue.Enqueue(currentValue)
                    If queue.Count < queueLength Then
                    Return Nothing
                    ElseIf queue.Count = queueLength And queueFull = False Then
                    queueFull = True
                    Return (queueSum-currentValue-currentValue) 
                    Else
                    Return (queueSum-currentValue-currentValue) 
                    End If
    End If
    End Function
    public function ClearQueue()
    Dim i as Integer
    Dim n as Integer = Queue.Count-1
    for i=n To 0 Step-1
                    queue.Dequeue()
    next i
    End function
    Thanks in Advance
    Priya

    Hi Priya,
    According to your description, you want to add a total row at bottom of the matrix. This total row should display the  both sum of amount every month and the sum of the difference between months. Right?
    Since we have tried the custom code in another similar thread you have posted before (Difference
    Between the grouped column) and it works properly. In this scenario, we just need to use the sum function and put it as a variable when calling the custom function in custom code, then we will get the total difference between months. This
    case has been tested in our local environment (In this sample, we used the same sample data as the last thread you posted before).Here are steps and screenshots for your reference:
    1. Add a row out side of group. Put the expressions into corresponding cells.
    2. Save and preview. The result looks like below:
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • Total for columns in ALV OO

    Hi,
    I have 20 fields in my OO ALV report which is working in background also.
    I need to get the subtotal for some of the numeric fields. I am using a single container for both background and online reports. I am using the class CL_GUI_ALV_GRID.
    Can someone please tell me how to get the total in the report which will work in background as well.
    Thanks in advance experts.

    Hi,
                           Use the method GET_SUBTOTALS
    of this class to get the subtotals by applying this method for
    the columns for which you need to calculate the subtotal.

  • Wrong SSAS Grand Total Value Monthly Value base on Weekly Value

    Dear All, 
    I Have calculated measures in my cube base on Weekly and Base on Monthly and different
    Template Base .
    For grand Total Weekly is fine but for Monthly is bad one.
    Say calculated Measure Name "Weekly" with Syntax
    CREATE MEMBER CURRENTCUBE.[Measures].[Weekly]
     AS IIF(isempty([Measures].[Actual Quantity MTD]) or [Measures].[Actual Quantity MTD]=0 or isempty([Measures].[Original Plan Quantity  MTD])   , null ,
    IIF([Measures].[Original Plan Quantity MTD] =0 or isempty([Measures].[Original Plan Quantity MTD]),null,   
    IIF( 
     ([Measures].[Actual Quantity MTD]-[Measures].[Original Plan Quantity MTD]) > 0 , 1 ,[Measures].[Actual Quantity MTD]/ [Measures].[Original Plan Quantity MTD] ))) 
    The Result is good
    here the picture
    http://hpics.li/9fd22f2
    https://drive.google.com/open?id=0ByY5H-XcydgiWGp0RzdWYWp0M2c&authuser=0
    and for Monthly Calculation  it was AVG of Weekly base on Time, Plant, and PSL Dimension 
    My calculated Monthly Measure Name "Monthly" with Syntax
    CREATE MEMBER CURRENTCUBE.[Measures].[Monthly]
     AS AVG ( 
    DESCENDANTS([PSL].[PSL Description])*
    DESCENDANTS([Plant].[Plant])*
    DESCENDANTS([Finish Date].[Calendar],[Finish Date].[Calendar].[Month Year]) 
    , AVG(([Finish Date].[Calendar].CURRENTMEMBER.CHILDREN), [Measures].[Weekly]))
    The Result is Bad on Grand total 
    here the Picture link 
    http://hpics.li/5233b50
    https://drive.google.com/open?id=0ByY5H-XcydgicEhtT1FpekRsbW8&authuser=0
    Please help me why for the Result doesn't same. What do i Miss
    Thank You 
    Yan

    Hi Yan,
    According to your description, you create a calculated measure in your cube, the problem is that grand Total for Monthly is incorrect, right?
    In your scenario, the issue can be caused by that you used "*" and "/" in your calculated measure. In SSAS, one of the most common issues faced in mdx is grand total or sub total not coming properly when some arithmetic operations like
    measure1 [* or + or - or /] measure2 is used, please refer to the link below to see the details.
    http://vnu10.blogspot.jp/2011/01/mdx-grand-total-sub-total.html
    Regards,

  • Customizing grand total columns in pivot view

    Hi,
    I need to customize grand total column name in pivot view
    ex: If i have two measure order quantity and order amount when i am selecting aggregation after in column properties it is getting grand total i need to display as grand total for OQ and grand total for OA
    Please give suggestions
    Thanks,
    Kartheek.
    Edited by: 998231 on May 26, 2013 11:31 PM

    Hi Kartheek,
    In Pivot View, the default Grand Total can not be renamed to have measure specific grand total labe (The one which we specify in the pivot view either by row or column).
    But you can try having one seperate measure (in criteria) which will calculate the grand total of each measure by dimensions, which are available on the report.
    In sort you can achieve this using table and narrative view together (Not by pivot view).
    Expresion to be used for grand total in report criteria is Sum( Measure By Dim1, dim2... DimN)
    where Dim1 and dim2 are the dimesional column available on the report and measure is you OQ/OA.
    Create a table view as a default view (do not add any report level agg) and then add narrative view to display the Grand total OQ and Grand Total OA. You can add your custom lables with HTML tag, disply the 1st row only as the values will be repeated for grand total.
    If you find any other solution do let me know. As of now I can think of this as a best solution.
    Regards,
    Kashi

  • Hide column result in pivot grand total row

    Hello
    Do you know if it is possible to hide the result of a particular column in a pivot grand total row?
    I have several columns to which makes sense use a grand total row (as in a sum) but for others (such as average) it does not make sense in the light of the client business rules.
    Any help on this matter is highly appreciated :)
    Thanks in advance,
    J Marques

    I have a measure that represents the average time according to the dimensions it uses - and that works properly.
    However, the grand total for that column shows me the average of the average times above. This is not correct that is why I want to hide it.As said by kishore, In pivot go to that time average time column -> Aggregation rule -> None, This won't affect the column avg value.
    The grant total value will not come.
    By setting this, are you getting wrong values?
    Thanks,
    Vino

Maybe you are looking for