Grand total based on blocks ..??

Hi all
My req. is like, I have 3 blocks, each block I have sum and each block data has on different filters. Now I want put Grand total by summing of all blocks sum. I tried to create variable and putting all filter conditions (3 blocks conditions) in where clause. But it returns last block sum value only. Is there a way to achieve this grand total?
Regards
swetha

Hi Swetha,
Lets consider two objects in report.
1. Year  (Available values : 2004,2005,2006)
2. Sales Revenue
Created three different variables in report for year.
2004, 2005 , 2006
And placed in different blocks.
And then applied the Total sum of Sales revenue in the third block.Please  find attached snapshot for the same.
Let me know if you have any issues.
Regards,
Pranay

Similar Messages

  • Calculating Grand Total based on the section totals

    Hi,
    I have a webi report with a section. Outside the section block I have a grand total block. I have a section on Shop Names. At the total level I calculate calls per hour average. So at the end of each sections the total would look like
    Shop 1
    Shop 1 Calls : 61
    Shop 2
    Shop 2 Calls : 45
    I need to calculate call per hour at the grand total ...which should average the totals in the section
    Grand Total : 61+45 = 106/2=53. I needed guidance as to how based on the section totals I can write a formula to calculate averages of the values present in the section. Both are different blocks ( Section and Grand Total)
    I cannot write a direct formula as it will give me error caculation beacuase of the nature of data in the report.
    Please let me kow on this.
    Thank You,

    Hi BOCP-BOE ,
    Thank you very much for the quick response.
    I tried with          
    =Sum([V_Calls_Per_Hour_Average]) ForAll ([V_Calls_Per_Hour_Average]) In Report
    =Sum([V_Calls_Per_Hour_Average]) ForEach ([V_Calls_Per_Hour_Average]) In Report
    But this gives me error
    I calculate calls per hour as a subtotal for each shop. ( There is a section on shop so for each shop under the section we will have calls per hour total)
    The formula to calculate calls per hour is little complex
    =If(Count([Date_Appeared];Distinct)=1;(Sum([Number Of Total Calls])/Average([Hours_Worked/60));(Sum( [Number Of Total Calls])/(Sum([Hours_Worked]/60) ForEach([Date_Appeared]) Where([Date_Appeared]<>Previous([Date_Appeared];Row)))))
    My think that the formula to calculate calls per hour has very little to do with summing the values for calls per hour. Please note that I have a V_Calls_Per_Hour_Average that holds that calculation.
    Please let me know on this.
    Thank You

  • Grand Total color

    Hi
    I am using 10g.I have pivot table re[port. In this report 3 rows dimension and 4 measure values.
    Now i set grand total based on row values.Grand total backround color dark blue display upto dimension row.After dimension sum(measures) shows normal color.
    My requirment is i should display full row for grand total is dark blue.How can i set pls let me know?
    Thanks
    Gram                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Try this
    Rows at Sigma sign->Format Lables
    Use Custom CSS Style->
    background-color: #ECEFF3; color: black;
    If works pls mark as correct :)
    Just in case you want to use same color of above values use
    color: #3C3C3C; instead of color: black;
    Edited by: Srini VEERAVALLI on Jan 9, 2013 9:52 PM
    BTW: For your other post "Pivot Col Heading " can you send me screenshot to my email
    Edited by: Srini VEERAVALLI on Jan 9, 2013 9:55 PM

  • Time Format (Grand Total) in OBIEE 11g

    Experts,
    In my Report Talk Time and Delay Time are present and I have enable the Grand Total based on Agency.
    i.e.
    Agency - Talk Time - Delay Time
    AgencyA 00:05:10 00:00:02
    AgencyB 00:02:12 00:00:01
    AgencyA 00:15:13 00:00:02
    AgencyC 00:10:10 00:00:25
    GrandTotal 00.00:32.00:45.00    00.00:00.00:35.00
    Look at Grand Total is shows like *00.00:32.00:45.00 ; 00.00:00.00:35.00*
    But our requirement should be *00:32:45 00:00:35* for Grand Total.
    Please let me know your valuable suggestions.
    Thanks,
    Balaa...

    Hi bala,
    Tricky one and good question,never tried this or got this type of requirment.
    did you aggregate the talk_time and delay_time,if so what is it ?? or did you use it as default one.
    Play with it like using server aggregation so it would determine the correct totals i suppose.
    hope helps you.
    Note:- If you get any solution or work around please post here so we could also learn & looking forward for other experts go on it.
    UPDATED POST
    Instead of sum as aggregate can you try server complex aggregation so server would decide how it would handle or
    even the max or min function .....its just playing with it to get a solution and check the query generated and run at the backend and see how the results are coming.
    Cheers,
    KK
    Edited by: Kranthi.K on Apr 18, 2011 2:08 AM

  • Grand Total Not working on Materialized view based table ??

    Hi all,
    I have a complex report report by using sum and decode function. I precalculated my requirment in database and then create a materialized view based on my sql statement. I import this view in physical and BM model and its results very fine and efficient. But the problem create when I implement Grand Total on my report in table view it did'nt work means (Grand Total is not working on this MV based table) Any idea why ??
    any reply would by higly appriciated.
    Regards

    Hi Zishan,
    Check the Aggregation Rule and set it to sum in the table view.
    That is go to the "edit formula" tab of the column for which you want grand total and set that to sum.
    Hope this will help.
    Thanks
    Ashok

  • Printing Grand Totals in Footer along with page total

    Hi
    I have a report which prints PO Header and PO Lines. For each page while iterating thru PO Lines I print page total in the footer.
    Once all PO Lines are printed with page totals in the footer of each page, I want to print Grand total in the last page in the footer along with last page total. Currently my XML data has pre-computed grand total in the PO Header block.
    The problem
    I have wrapped header and lines inside <?start:body?> and <?end:body?> which allows me to print page totals outside the <?end:body?> tag.
    I print page totals and "Continue" next to it in the footer. But
    Finally when grand total comes into picture in the outer loop I want to replace "Continue" text with grand total value in the last page and print it as footer.
    I tried to use xdoxlt:set_variable() function to flag a variable value to 1 when iteration happens in HEADER block and set it to 2 in inner loop of lines block. But the scope of the variable is confined between <?start:body?> and < ?end:body? and is not visible outside the <?end:body?> tag.
    The logic I want to accomplish is
    if var = 1 then
    print page total and "Continue"
    elsif var = 2 then
    print page total and Grand Total.
    end if
    This logic doest work as the value of var is not visible outside the body tag.
    I want to use this variable value to print footer which lies outside <?end:body?> tag with grand totalor page total
    Please suggest if there is any other way I can accomplish this functionality. Can we use parameter and update it. Syntax for update parameter value is not clear in user guide.
    Any help would be appreciated.
    thanks
    sukarna

    thanks for the info, i was trying to avoid this but had already reached the same conclusion.
    everything else seems to be very time consuming and may not work correctly in the end.
    we're on Oracle Applications : 11.5.10.2 which has just been converted to utf-8 and is an Oracle On-Demand installation.
    do you know if 5.6.3 of the publisher is supported and any ideas on how difficult it is to get it installed?
    cheers
    ellen

  • What is the use of Grand total level in obiee ,

    hi ,
    i know that we can perform drill down from one level to another level, level base measures ,aggregate atble.................
    apart from that any other user if so pls give me one small example
    What is the use of Grand total level in obiee

    When you start to use multi-star models and none-conforming dimensions, you will use the grand total level to tell the BI Server what to do with the measures when you try and plot them all in the same answers request.
    Also consider any meaure you want to perform a '% of total' you will need the total mapped somewhere, this could use the Grand total level as a level based measure.
    Regards
    Alastair

  • ALV GRID - Text for Grand Total

    Hi guys,
    In ALV Grid, i need to display the Text 'GRAND TOTAL' at the left side of the row(Yellow line).
    I have tried searching in the forum but didn't get the answer.
    Please advice.
    Thanks
    Chintu

    Hi
    <br><br>
    IF you copy and past this might not work but this is the sample code<br><br>
    <pre>
    REPORT  Y_DOWN_TIME_ENTRYSRA.
    TABLES : YDOWNTIME1.
    TYPE-POOLS : SLIS.
    *INTERNAL TABLE DECLARTION
    data : l_layout type slis_layout_alv,
           x_events type slis_alv_event,
           it_events type slis_t_event.
    DATA :ITAB LIKE YDOWNTIME1 OCCURS 0 WITH HEADER LINE .
    data :  GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
          wa_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
    **********************SELECTION PARAMETERS ************************
    PARAMETERS: CB1 RADIOBUTTON GROUP G1 ,
                CB2 RADIOBUTTON GROUP G1 ,
                cb3 RADIOBUTTON GROUP G1 ,
                CB4 RADIOBUTTON GROUP G1 ,
                CB5 RADIOBUTTON GROUP G1 ,
                CB6 RADIOBUTTON GROUP G1 ,
                CB7 RADIOBUTTON GROUP G1 ,
                CB8 RADIOBUTTON GROUP G1 ,
                CB9 RADIOBUTTON GROUP G1 .
               CB10 RADIOBUTTON GROUP G1,
               CB11 RADIOBUTTON GROUP G1.
    DATA : A TYPE C.
    SELECTION-SCREEN BEGIN OF BLOCK BK1 WITH FRAME TITLE TEXT-001.
      SELECT-OPTIONS :S_EQUNR         FOR  YDOWNTIME1-EQUNR ,
                      S_ERDop        FOR  YDOWNTIME1-ERDAT,
                      S_MFSTT         FOR  YDOWNTIME1-MFSTART.
      PARAMETERS :    P_SHIFT         TYPE YDOWNTIME1-SHIFT,
                      P_CHARG         TYPE YDOWNTIME1-CHARG,
                      p_COGRU         TYPE YDOWNTIME1-QMGRP,
                      P_CODE          TYPE YDOWNTIME1-COde,
                     p_name          type ydowntime1-OPNAME,
                      p_sup           TYPE YDOWNTIME1-SUPERVISOR,
                      P_MANG           TYPE YDOWNTIME1-MANG.
    SELECTION-SCREEN END OF BLOCK BK1 .
    AT SELECTION-SCREEN.
      IF CB1 EQ 'X'.
        select  * from YDOWNTIME1
             INTO  CORRESPONDING FIELDS OF TABLE   ITAB
                   where erdat in S_ERDop  .
      ELSEIF CB2 EQ 'X' .
         select  * from YDOWNTIME1
           INTO  CORRESPONDING FIELDS OF TABLE   ITAB
           where erdat in S_ERDop and  charg eq p_charg .
      ELSEIF CB3 EQ 'X' .
         select  * from YDOWNTIME1
           INTO  CORRESPONDING FIELDS OF TABLE   ITAB
           where erdat in S_ERDop and charg  eq p_charg and shift eq P_SHIFT .
      ELSEIF  CB4 EQ 'X' .
        select  * from YDOWNTIME1
           INTO  CORRESPONDING FIELDS OF TABLE   ITAB
           where  code eq p_code and  erdat in S_ERDop.
      ELSEIF  CB5 EQ 'X' .
        select  * from YDOWNTIME1
           INTO  CORRESPONDING FIELDS OF TABLE   ITAB
           where  erdat in S_ERDop and EQUNR in S_EQUNR and QMGRP eq p_COGRU.
      ELSEIF  CB6 EQ 'X' .
        select  * from YDOWNTIME1
           INTO  CORRESPONDING FIELDS OF TABLE   ITAB
           where  OPNAME eq p_name and  erdat in S_ERDop.
      ELSEIF   CB7 EQ 'X' .
        select  * from YDOWNTIME1
           INTO  CORRESPONDING FIELDS OF TABLE   ITAB
           where SUPERVISOR eq p_sup and  erdat in S_ERDop.
      ELSEIF   CB8 EQ 'X' .
        select  * from YDOWNTIME1
           INTO  CORRESPONDING FIELDS OF TABLE   ITAB
           where MANG eq p_MANG and  erdat in S_ERDop.
      ELSEIF   CB9 EQ 'X'.
        select  * from YDOWNTIME1
           INTO  CORRESPONDING FIELDS OF TABLE   ITAB
           where erdat in S_ERDop and EQUNR in S_EQUNR.
      endif.
    loop at itab.
    if itab-schno > 1.
      A = '  '.
      move A to itab-DCOR .
      move A to itab-DCCR .
      move A to itab-DCNR .
      modify itab.
    endif.
    endloop.
    perform create_fieldcat.
    data: sort type slis_sortinfo_alv,
          it_sort type  SLIS_T_SORTINFO_ALV.
    sort-fieldname = 'EQUNR'.
    sort-up = 'X'.
    sort-subtot = 'X'.
    APPEND sort to it_sort.
    sort-fieldname = 'SHIFT'.
    sort-up = 'X'.
    *sort-subtot = 'X'.
    APPEND sort to it_sort.
    l_layout-TOTALS_TEXT = 'TOTAL'.
    l_layout-SUBTOTALS_TEXT = 'SUBTOTAL'.
       CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
        i_callback_program       = sy-repid
        is_layout                = l_layout
        it_fieldcat              = gt_fieldcat
        it_events                = it_events
        it_sort                  = it_sort
      TABLES
        T_OUTTAB                       = ITAB
    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.
    *&      Form  CREATE_FIELDCAT
          text
    -->  p1        text
    <--  p2        text
    FORM CREATE_FIELDCAT .
      DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-ROW_POS     = '1'.
      LS_FIELDCAT-COL_POS     = '1'.
      LS_FIELDCAT-FIELDNAME   = 'ERDAT'.
      LS_FIELDCAT-KEY         = ''.
      LS_FIELDCAT-OUTPUTLEN   = '12'.
    ls_fieldcat-do_sum       = 'X'.
      LS_FIELDCAT-SELTEXT_L =  'Date'.
      APPEND LS_FIELDCAT TO GT_FIELDCAT.
      clear LS_FIELDCAT .
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-ROW_POS     = '1'.
      LS_FIELDCAT-COL_POS     = '2'.
      LS_FIELDCAT-FIELDNAME   = 'UZEIT'.
      LS_FIELDCAT-KEY         = ''.
      LS_FIELDCAT-OUTPUTLEN   = '8'.
      LS_FIELDCAT-SELTEXT_L =  'Time'.
      APPEND LS_FIELDCAT TO GT_FIELDCAT.
        clear LS_FIELDCAT .
       CLEAR LS_FIELDCAT.
      LS_FIELDCAT-ROW_POS     = '1'.
      LS_FIELDCAT-COL_POS     = '2'.
      LS_FIELDCAT-FIELDNAME   = 'EQUNR'.
      LS_FIELDCAT-KEY         = ''.
      LS_FIELDCAT-OUTPUTLEN   = '8'.
      LS_FIELDCAT-SELTEXT_L =  'Equipment'.
      APPEND LS_FIELDCAT TO GT_FIELDCAT.
        clear LS_FIELDCAT .
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-ROW_POS     = '1'.
      LS_FIELDCAT-COL_POS     = '2'.
      LS_FIELDCAT-FIELDNAME   = 'CODE'.
      LS_FIELDCAT-KEY         = ''.
      LS_FIELDCAT-OUTPUTLEN   = '12'.
      LS_FIELDCAT-SELTEXT_L =  'CODE'.
      APPEND LS_FIELDCAT TO GT_FIELDCAT.
        clear LS_FIELDCAT .
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-ROW_POS     = '1'.
      LS_FIELDCAT-COL_POS     = '3'.
      LS_FIELDCAT-FIELDNAME   = 'QMGRP'.
      LS_FIELDCAT-KEY         = ''.
      LS_FIELDCAT-OUTPUTLEN   = '20'.
      LS_FIELDCAT-SELTEXT_L =  'Code Group'.
      APPEND LS_FIELDCAT TO GT_FIELDCAT.
        clear LS_FIELDCAT .
    CLEAR LS_FIELDCAT.
      LS_FIELDCAT-ROW_POS     = '1'.
      LS_FIELDCAT-COL_POS     = '3'.
      LS_FIELDCAT-FIELDNAME   = 'KURZTEXT'.
      LS_FIELDCAT-KEY         = ''.
      LS_FIELDCAT-OUTPUTLEN   = '40'.
      LS_FIELDCAT-SELTEXT_L =  'Code Text'.
      APPEND LS_FIELDCAT TO GT_FIELDCAT.
        clear LS_FIELDCAT .
       CLEAR LS_FIELDCAT.
      LS_FIELDCAT-ROW_POS     = '1'.
      LS_FIELDCAT-COL_POS     = '7'.
      LS_FIELDCAT-FIELDNAME   = 'DCOR'.
      LS_FIELDCAT-KEY         = ''.
      LS_FIELDCAT-OUTPUTLEN   = '14'.
      LS_FIELDCAT-SELTEXT_L =  'Opening Dips'.
      APPEND LS_FIELDCAT TO GT_FIELDCAT.
        clear LS_FIELDCAT .
        CLEAR LS_FIELDCAT.
      LS_FIELDCAT-ROW_POS     = '1'.
      LS_FIELDCAT-COL_POS     = '8'.
      LS_FIELDCAT-FIELDNAME   = 'DCCR'.
      LS_FIELDCAT-KEY         = ''.
      LS_FIELDCAT-OUTPUTLEN   = '14'.
      LS_FIELDCAT-SELTEXT_L =  'Closing Dips'.
      APPEND LS_FIELDCAT TO GT_FIELDCAT.
        clear LS_FIELDCAT .
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-ROW_POS     = '1'.
      LS_FIELDCAT-COL_POS     = '9'.
      LS_FIELDCAT-FIELDNAME   = 'DCNR'.
      LS_FIELDCAT-KEY         = ''.
      LS_FIELDCAT-OUTPUTLEN   = '10'.
      ls_fieldcat-do_sum       = 'X'.
      LS_FIELDCAT-SELTEXT_L =  'Net Dips'.
      APPEND LS_FIELDCAT TO GT_FIELDCAT.
        clear LS_FIELDCAT .
    CLEAR LS_FIELDCAT.
    LS_FIELDCAT-ROW_POS     = '1'.
    LS_FIELDCAT-COL_POS     = '9'.
    LS_FIELDCAT-FIELDNAME   = 'PRO'.
    LS_FIELDCAT-KEY         = ''.
    LS_FIELDCAT-OUTPUTLEN   = '10'.
    ls_fieldcat-do_sum       = 'X'.
    LS_FIELDCAT-SELTEXT_L =  'PROD IN LAC'.
    APPEND LS_FIELDCAT TO GT_FIELDCAT.
       clear LS_FIELDCAT .
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-ROW_POS     = '1'.
      LS_FIELDCAT-COL_POS     = '4'.
      LS_FIELDCAT-FIELDNAME   = 'CHARG'.
      LS_FIELDCAT-KEY         = ''.
      LS_FIELDCAT-OUTPUTLEN   = '12'.
      ls_fieldcat-do_sum       = 'X'.
      LS_FIELDCAT-SELTEXT_L =  'Batch Number'.
      APPEND LS_FIELDCAT TO GT_FIELDCAT.
        clear LS_FIELDCAT .
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-ROW_POS     = '1'.
      LS_FIELDCAT-COL_POS     = '6'.
      LS_FIELDCAT-FIELDNAME   = 'OPNAME'.
      LS_FIELDCAT-KEY         = ''.
      LS_FIELDCAT-OUTPUTLEN   = '20'.
      LS_FIELDCAT-SELTEXT_L =  'Operators Name'.
      APPEND LS_FIELDCAT TO GT_FIELDCAT.
        clear LS_FIELDCAT .
    CLEAR LS_FIELDCAT.
      LS_FIELDCAT-ROW_POS     = '1'.
      LS_FIELDCAT-COL_POS     = '6'.
      LS_FIELDCAT-FIELDNAME   = 'SUPERVISOR'.
      LS_FIELDCAT-KEY         = ''.
      LS_FIELDCAT-OUTPUTLEN   = '20'.
      LS_FIELDCAT-SELTEXT_L =  'Supervisor Name'.
      APPEND LS_FIELDCAT TO GT_FIELDCAT.
        clear LS_FIELDCAT .
         CLEAR LS_FIELDCAT.
      LS_FIELDCAT-ROW_POS     = '1'.
      LS_FIELDCAT-COL_POS     = '6'.
      LS_FIELDCAT-FIELDNAME   = 'MANG'.
      LS_FIELDCAT-KEY         = ''.
      LS_FIELDCAT-OUTPUTLEN   = '20'.
      LS_FIELDCAT-SELTEXT_L =  'Manager'.
      APPEND LS_FIELDCAT TO GT_FIELDCAT.
        clear LS_FIELDCAT .
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-ROW_POS     = '1'.
      LS_FIELDCAT-COL_POS     = '6'.
      LS_FIELDCAT-FIELDNAME   = 'SHIFT'.
      LS_FIELDCAT-KEY         = ''.
      LS_FIELDCAT-OUTPUTLEN   = '20'.
      LS_FIELDCAT-SELTEXT_L =  'Shift'.
      APPEND LS_FIELDCAT TO GT_FIELDCAT.
        clear LS_FIELDCAT .
    CLEAR LS_FIELDCAT.
      LS_FIELDCAT-ROW_POS     = '1'.
      LS_FIELDCAT-COL_POS     = '9'.
      LS_FIELDCAT-FIELDNAME   = 'MFSTART'.
      LS_FIELDCAT-KEY         = ''.
      LS_FIELDCAT-OUTPUTLEN   = '10'.
      LS_FIELDCAT-SELTEXT_L =  'Start Time'.
      APPEND LS_FIELDCAT TO GT_FIELDCAT.
        clear LS_FIELDCAT .
       CLEAR LS_FIELDCAT.
      LS_FIELDCAT-ROW_POS     = '1'.
      LS_FIELDCAT-COL_POS     = '9'.
      LS_FIELDCAT-FIELDNAME   = 'MFEND'.
      LS_FIELDCAT-KEY         = ''.
      LS_FIELDCAT-OUTPUTLEN   = '10'.
      LS_FIELDCAT-SELTEXT_L =  'End Time'.
      APPEND LS_FIELDCAT TO GT_FIELDCAT.
        clear LS_FIELDCAT .
       CLEAR LS_FIELDCAT.
      LS_FIELDCAT-ROW_POS     = '1'.
      LS_FIELDCAT-COL_POS     = '9'.
      LS_FIELDCAT-FIELDNAME   = 'DURATION'.
      LS_FIELDCAT-KEY         = ''.
      LS_FIELDCAT-OUTPUTLEN   = '10'.
      ls_fieldcat-do_sum       = 'X'.
      LS_FIELDCAT-SELTEXT_L =  'DURATION'.
      APPEND LS_FIELDCAT TO GT_FIELDCAT.
        clear LS_FIELDCAT .
        CLEAR LS_FIELDCAT.
      LS_FIELDCAT-ROW_POS     = '1'.
      LS_FIELDCAT-COL_POS     = '9'.
      LS_FIELDCAT-FIELDNAME   = 'ZUNIT'.
      LS_FIELDCAT-KEY         = ''.
      LS_FIELDCAT-OUTPUTLEN   = '10'.
      LS_FIELDCAT-SELTEXT_L =  'UNIT'.
      APPEND LS_FIELDCAT TO GT_FIELDCAT.
        clear LS_FIELDCAT .
    ENDFORM.                    " CREATE_FIELDCAT
    </pre>
    Edited by: Matt on Sep 3, 2009 12:06 PM

  • Alv grand total

    hi gurus pls help me on this issue....... i want grand total on each column of this report.
    for example field 'metric-safety'. if possbile try to edit this and send me.
    TYPE-POOLS : slis.
    Tables : Marc, " Plant Data for Material
    Mbew, " Material Valuation
    Ekpo, " Purchasing Document Item
    Eord, " Purchasing Source List
    Zpmt. " Purchasing Metric Table
    Internal Tables Declaration----
    Data : Begin of metric occurs 0,
    matnr like marc-matnr, " Material number
    werks like marc-werks, " Plant
    minbe like marc-minbe, " Recoder Point
    eisbe like marc-eisbe, " Safety Stock
    stprs like mbew-stprs, " Standard Price
    lifnr like eord-lifnr, " Vendor
    menge like ekpo-menge, " PO Quantity
    scalc type p decimals 2,
    safety(20) type c,
    tcalc type p decimals 2,
    Target(20) type c,
    acalc type p decimals 2,
    actual(20) type c,
    ecalc type p decimals 2,
    excess(20) type c,
    ucalc type p decimals 2,
    usafety(20) type c,
    *******Custom table
    inscr like zpmt-inscr, " Inventory Score
    stkot like zpmt-stkot, " Stock Out
    impct like zpmt-impct, " Impact
    nafta like zpmt-nafta, " %nafta
    stscr like zpmt-stscr, " Stock Out Score
    end of metric.
    Data : final like metric occurs 0 with header line.
    DATA: fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    **Data : Begin of output occurs 0,
    lifnr like eord-lifnr, " Vendor
    eisbe like marc-eisbe, " Safety Stock
    minbe like marc-minbe, " Re-order Point
    stprs like mbew-stprs, " Standard Price
    sstock(13) type c, " Value of Safety Stock
    Actual(13) type c, " Actual
    Excess(13) type c, " Excess Inv
    underSs(13) type c, " Under Safety Stock
    end of output.
    Data type Declaration----
    Data : a type c value '$'.
    Data : safety(20) type c,
    target(20) type c,
    actual(20) type c,
    excess(20) type c,
    usafety(20) type c,
    repid like sy-repid.
    data : i_pos type i.
    Selection Screen----
    selection-screen : begin of block b1 with frame Title tname.
    Select-options: Mat for marc-matnr, " Material Number Selection
    Plt for marc-werks, " Plant Selection
    Vdr for eord-lifnr. " Vendor Selection
    selection-screen : end of block b1.
    Initialization----
    initialization.
    tname = 'Purchasing Metric Report'.
    At Selection-Screen----
    At selection-screen.
    IF mat = ' ' and Plt = ' ' and Vdr = ' '.
    message e000.
    *elseif mat metric-matnr.
    *message e001.
    *elseif plt metric-werks.
    *message e002.
    *elseif vdr metric-lifnr.
    *message e003.
    endif.
    Start-of-Selection----
    Start-of-selection.
    *******For Data Retrival
    Perform Data_retrival.
    *******For Calculation
    Perform Calculation.
    *******For Building Fieldcatalog
    Perform Build_fieldcatalog.
    *******Alv Display
    Perform Alv_display.
    *& Form Get_Data
    text
    FORM Data_retrival .
    SELECT a~matnr
    a~werks
    a~eisbe
    a~minbe
    b~matnr
    b~stprs
    c~matnr
    c~lifnr
    d~matnr
    d~menge
    into corresponding fields of table metric from
    ( ( ( marc as a inner join mbew as b on bmatnr = amatnr )
    inner join eord as c on cmatnr = amatnr )
    inner join ekpo as d on dmatnr = amatnr )
    where amatnr in mat and awerks in plt and c~lifnr in vdr.
    if sy-subrc = 0.
    sort metric by matnr.
    endif.
    ENDFORM. " Get_Data
    *& Form Calculation
    text
    FORM Calculation .
    loop at metric.
    ******calculation for safety stock ( safety stock * standard price )
    metric-scalc = metric-eisbe * metric-stprs.
    move metric-scalc to safety.
    condense safety.
    concatenate a safety into metric-safety.
    ******calculation for target ( safety stock + standard price )
    metric-tcalc = ( metric-eisbe * metric-stprs ) + metric-stprs.
    move metric-tcalc to target.
    condense target.
    concatenate a target into metric-target.
    ******calculation for Actual ( Po quantity * standard price )
    metric-acalc = metric-menge * metric-stprs.
    move metric-acalc to actual.
    condense actual.
    concatenate a actual into metric-actual.
    ******calculation for Excess Inv ( Actual - Target )
    metric-ecalc = ( metric-menge * metric-stprs ) - ( ( metric-eisbe * metric-stprs ) + metric-stprs ).
    move metric-ecalc to excess.
    condense excess.
    concatenate a excess into metric-excess.
    ******calculation for Under Safety Stock ( actual < safety stock. then actual + safety stock (Else) zero )
    if actual < safety.
    metric-menge * metric-stprs < metric-eisbe * metric-stprs.
    metric-ucalc = ( metric-menge * metric-stprs ) + ( metric-eisbe * metric-stprs ).
    else.
    metric-ucalc = 0.
    endif.
    move metric-ucalc to usafety.
    condense usafety.
    concatenate a usafety into metric-usafety.
    collect metric into final.
    endloop.
    ENDFORM. " Calculation
    *--End-for-Selection--
    *end-of-selection.
    *loop at final.
    *write : / final-lifnr, final-safety, final-target, final-actual, final-excess, final-usafety.
    *endloop.
    *& Form Build_fieldcatalog
    text
    --> p1 text
    <-- p2 text
    FORM Build_fieldcatalog .
    fcat-fieldname = 'LIFNR'.
    fcat-seltext_m = 'Vendor'.
    fcat-col_pos = i_pos.
    fcat-outputlen = 10.
    fcat-emphasize = 'X'.
    fcat-key = 'X'.
    fcat-do_sum = 'X'.
    fcat-edit = 'X'.
    append fcat to fcat.
    clear fcat.
    i_pos = i_pos + 1.
    fcat-fieldname = 'SAFETY'.
    fcat-seltext_m = 'Safety Stock'.
    fcat-col_pos = 2.
    fcat-outputlen = 10.
    fcat-emphasize = 'X'.
    fcat-do_sum = 'X'.
    fieldcatalog-key = 'X'.
    append fcat to fcat.
    clear fcat.
    fcat-fieldname = 'ACTUAL'.
    fcat-seltext_m = 'Actual'.
    fcat-col_pos = 3.
    fcat-outputlen = 10.
    fcat-emphasize = 'X'.
    fcat-do_sum = 'X'.
    fieldcatalog-key = 'X'.
    append fcat to fcat.
    clear fcat.
    fcat-fieldname = 'TARGET'.
    fcat-seltext_m = 'Target'.
    fcat-col_pos = 4.
    fcat-outputlen = 10.
    fcat-emphasize = 'X'.
    fieldcatalog-key = 'X'.
    append fcat to fcat.
    clear fcat.
    fcat-fieldname = 'EXCESS'.
    fcat-seltext_m = 'Excess Inv'.
    fcat-col_pos = 5.
    fcat-outputlen = 10.
    fcat-emphasize = 'X'.
    fieldcatalog-key = 'X'.
    append fcat to fcat.
    clear fcat.
    fcat-fieldname = 'USAFETY'.
    fcat-seltext_m = 'Under Safety Stock'.
    fcat-col_pos = 6.
    fcat-outputlen = 20.
    fcat-emphasize = 'X'.
    fieldcatalog-key = 'X'.
    append fcat to fcat.
    clear fcat.
    fcat-fieldname = 'INSCR'.
    fcat-seltext_m = 'Iventory Score'.
    fcat-col_pos = 7.
    fcat-outputlen = 20.
    fcat-emphasize = 'X'.
    fieldcatalog-key = 'X'.
    append fcat to fcat.
    clear fcat.
    fcat-fieldname = 'STKOT'.
    fcat-seltext_m = 'Stock Out'.
    fcat-col_pos = 6.
    fcat-outputlen = 20.
    fcat-emphasize = 'X'.
    fieldcatalog-key = 'X'.
    append fcat to fcat.
    clear fcat.
    fcat-fieldname = 'IMPCT'.
    fcat-seltext_m = 'Impact'.
    fcat-col_pos = 6.
    fcat-outputlen = 20.
    fcat-emphasize = 'X'.
    fieldcatalog-key = 'X'.
    append fcat to fcat.
    clear fcat.
    fcat-fieldname = 'NAFTA'.
    fcat-seltext_m = '%Nafta'.
    fcat-col_pos = 6.
    fcat-outputlen = 20.
    fcat-emphasize = 'X'.
    fieldcatalog-key = 'X'.
    append fcat to fcat.
    clear fcat.
    fcat-fieldname = 'STSCR'.
    fcat-seltext_m = 'Safety Out Score'.
    fcat-col_pos = 6.
    fcat-outputlen = 20.
    fcat-emphasize = 'X'.
    fieldcatalog-key = 'X'.
    append fcat to fcat.
    clear fcat.
    ENDFORM. " Build_fieldcatalog
    *& Form Alv_display
    text
    --> p1 text
    <-- p2 text
    FORM Alv_display .
    repid = sy-repid.
    *CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE = ' '
    I_CALLBACK_PROGRAM = repid
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = ' '
    I_STRUCTURE_NAME =
    IS_LAYOUT =
    IT_FIELDCAT = fcat[]
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_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
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
    TABLES
    T_OUTTAB = final
    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.
    repid = sy-repid.
    call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
    i_callback_program = repid
    i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
    i_callback_user_command = 'USER_COMMAND'
    i_grid_title = outtext
    is_layout = gd_layout
    it_fieldcat = fcat[]
    it_special_groups = gd_tabgroup
    it_events = gt_events
    is_print = gd_prntparams
    i_save = 'X'
    is_variant = z_template
    tables
    t_outtab = final
    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.
    thx in advance

    hi,
    for subtotal and grand total do the same thing like following,
    DATA: GS_SORT TYPE SLIS_SORTINFO_ALV.
    CLEAR GS_SORT.
    GS_SORT-FIELDNAME = 'FIELD1'.
    GS_SORT-SPOS      = 1.
    GS_SORT-UP        = 'X'.
    GS_SORT-SUBTOT    = 'X'.
    APPEND GS_SORT TO GT_SORT.
    CLEAR GS_SORT.
    GS_SORT-FIELDNAME = 'FIELD2'.
    GS_SORT-SPOS      = 2.
    GS_SORT-UP        = 'X'.
    *GS_SORT-SUBTOT    = 'X'.
    APPEND GS_SORT TO GT_SORT.
    if uesful rewars points

  • % of calculation in GRAND TOTAL in PIVOT TABLE

    Hi Gurus,
    I have a requirement to calculate the percentage based on the grand total in pivot table,but in row wise i am getting the percentage while in grand total level i am not getting correct values.I have tried with all the options like:average,Sum,Default,Max,Min,count etc and also with the percent of row,column,parent column etc.
    Please give me a solution for this ASAP.
    view of my table is
    Previous Value||Present Value||change between Pres & Prev||% of change(((pres - prev)/pres)*100)
    10||20||10||50%
    00||01||01||100%
    10||05||-05||-50%
    here i should get values in grand total like
    20||26||06||23%
    but i am getting values when giving sum for %of calc in measures values
    20||26||06||100%
    if i give avg for %of calc in measures values then i am geting
    20||26||06||33%
    how to solve this prob.Can any one give sol plzzzzzzzz
    Thanks,
    Naveen

    Hi,
    Refer : http://www.skurabigroup.com/blog/?p=579
    Regards,
    Srikanth

  • Pivot view grand total navigation

    Users want to navigate on pivot view grandtotal to next level report based on grand total value.I can only do column heading and column value navigation as per my knowledge.Anyway these values are calculated on the fly and not stored in the database.Storing these totals seems to be impossible as this values change dynamically.
    Do we have any alternate solution ?
    If this was discussed in this forum before- my apologies as i coudn't find in search criteria.
    Thanks

    This doesn't make sense to me. Why would you want to drill/navigate based on a grand total value? The value displayed in the grand total comprises individual rows summed up. Therefore, it is the rows that give the total significance. If it is an individual row that makes the total "something worth investigating," the user should click on a value. If the pivot table is one of many in the view, than each table has a common value (region, account number, product code, etc.). Use this value as the interactive value. These make more sense as link to a more detailed report.
    Having said all that, please explain why it is essential that the grand total value be use as the link, because there just might be a good reason. But as far as I know, it can't be done.

  • Grand total on a calculated item

    Hi,
    I have a crosstab report in discoverer plus 10g. I need to show total at the bottom for two calculated columns, report looks something like below
         COMPANY     Beginning Bal     Ending Bal     Net Amount
         1457     $35,467.90      $39,875.87      $359
         -     -     -     $453
         -     -     -     $564
         -     -     -     $347
         -     -     -     $234
         1568     $65,893.56      $76,594.87      $674
         -     -     -     $564
         -     -     -     $536
         -     -     -     $538
         -     -     -     $364
         -     -     -     $392
    Grand Total                    
    Net amount is a datapoint, but the beginning balance and ending balance are the calculated items in the report. is it possible to show the total for these calculated items? Please let me know if this is possible.
    Thanks,
    Nivas.

    Hi,
    Thanks for the reply.
    I have tried with cell sum but it is not displaying any total.
    beginning balance is a calculated item which is not based on any aggregated function
    beginning balance =
    CASE WHEN "ROW NUM" = "Max Row Num" THEN "worksheet".Beg Bal ELSE TO_NUMBER('') END
    same is the calculation for ending balance.
    I have account, company, beg bal, end bal, net amount to be displayed in the report.
    when I do cell sum by company every thing is fine, i get the totals displayed, but when i try with account then no totals are displayed in the report.
    please let me know if I am missing some thing.
    Thanks,
    Nivas.

  • GRAND TOTAL ON PAGE 3 OF DOCUMENT

    I have a order form, the first page is totaling fine for that page and the total on that page is called amount3 totaling all amount 1's, this is a interactive form. and I am using calcform
    Page 2 is also totaling correctly for page 2 but only page 2. the total box is called amount2 and it is totaling anything in the amount1 also.
    page 3 I would like to have it total all three for a grand total and it is not.
    here is what I am using for the first two pages
    SUM(AMOUNT1[*])
    here is what I have used on page 3 based on some of the other answers but something is not correct
    ----- scrip.Page3.GrandTotal::calculate: - (FormCalc, client) --------------------------------------
    sum(AMOUNT3,AMOUNT2,scrip.PAGE1.scrip.PAGE2)
    can anybody help a example would really help or tell me exactly what to do I am new at these formulas, excel I can do in my sleep but this I am not at all sure about.
    thanks
    Kathie

    Kathie Reed,
    This forum is for questions on Adobe's
    Solution Accelerator SDKs. The
    LiveCycle Designer ES forum would be a better place for this thread.
    That being said, assuming you have amount1 on page1 and amount2 on page2, you can get amount3 on page3 to show the sum of amount1 and amount2 by setting its Calculate script to this, in FormCalc:
    SUM(page1.amount1, page2.amount2)
    Stefan
    Adobe Systems
    More answers at
    Stefan Cameron on Forms.

  • Grand Total % Variance

    Hi,
    I have a Report for GL Reconciliation and it shows Source System Balances and GL Balances along with the Variance in these two and % Variance.
    Sample data is as follows:
    Year     Month     SYS     Source System Bal GL Balances     Variance     % Variance
    2010     MAY     A     66,100,676,002     60,994,246,811     -5106429191     -8.37%
    2010     MAY     B     29,081,192,665     29,066,650,415     -14542249.78     -0.05%
    2010     MAY     C     218,856,115     212,416,688     -6439426.71     -3.03%
    2010     MAY     D     14,601,939               -100.00%
    2010     MAY     E     808,716,681     822,453,990     13737309.05     1.67%
    2010     MAY     F     5,874,200,259     6,856,456,401     982256141.3     14.33%
    2010     MAY     G     2,181,160,124     2,164,379,222     -16780901.26     -0.78%
    2010     MAY     H     10,505,609,797     23,529,905,894     13024296097     55.35%
    2010     MAY     I     1,566,030,457     1,565,502,039     -528418.48     -0.03%
    2010     MAY     J     1,479,284,089          100.00%
    2010     MAY     K     10,939,680,559     7,481,930,011     -3457750548     -46.21%
    2010     MAY     L     8,774,737,817     8,831,160,339     56422521.84     0.64%
    2010     MAY     M     1,117,717,954     548,331,847     -569386106.3     -103.84%
    2010     MAY     N     73,670,961     55,680,430     -17990531.39     -32.31%
    2010     MAY     O     4,583,263,229     4,562,122,752     -21140477.19     -0.46%
    2010     MAY     P     204,382,965     206,288,734     1905768.97     0.92%
    2010     MAY NULL          332,763,879          100.00%
         MAYTotal          142,044,497,524     148,709,573,543     6665076018     4.48%
    Now This is how the Report will work as Normal...
    What the user wants is Instead of Variance he wants to see the Absolute variance. So If I run absolute function on This Column, I will get following results:
    ABS(Variance)
    5,106,429,191
    14,542,250
    6,439,427
    13,737,309
    982,256,141
    16,780,901
    13,024,296,097
    528,418
    3,457,750,548
    56,422,522
    569,386,106
    17,990,531
    21,140,477
    1,905,769
    6665076018 --- -This Total is Incorrect as it is showing only the Absolute value to the Total, where as it should be More than this and to achieve this, I changed the Aggreegation Rule to SUM
    to Get the correct sum of the figures mentioned ablove which will show following output:
    ABS(Variance)
    5,106,429,191
    14,542,250
    6,439,427
    13,737,309
    982,256,141
    16,780,901
    13,024,296,097
    528,418
    3,457,750,548
    56,422,522
    569,386,106
    17,990,531
    21,140,477
    1,905,769
    23,289,605,688
    Now Till this point everything is correct and can be achieved. The problem is with the % Variance:
    Bydefault % Variance ( Calculated using Variance/GL Balances )*100 Is as follows:
    % Variance
    -8.37%
    -0.05%
    -3.03%
    -100.00%
    1.67%
    14.33%
    -0.78%
    55.35%
    -0.03%
    100.00%
    -46.21%
    0.64%
    -103.84%
    -32.31%
    -0.46%
    0.92%
    100.00%
    4.48%
    But the Users wants that The % variance be calculated on Variance Column and GL Balances Column ( Variance/ GL Balances)*100
    But the Grand Total values at the bottom should be based on ( Grand Total of ABS(Variance)/ Grand Total of GL Balances ) *100
    to get the Desired results as :
    % Variance
    -8.37%
    -0.05%
    -3.03%
    -100.00%
    1.67%
    14.33%
    -0.78%
    55.35%
    -0.03%
    100.00%
    -46.21%
    0.64%
    -103.84%
    -32.31%
    -0.46%
    0.92%
    100.00%
    15.66%
    (23,289,605,688/1,48,709,573,543)*100
    If someone can help me with this...
    Edited by: help-required on Oct 1, 2010 1:14 AM

    OK, there are a couple of things that have to be pointed out before getting to the actual problem. First of all, the column you named "Variance" is not a variance, but a "difference" and should be labeled as such. Second, what is the variance you are trying to calculate?
    If the variance is from the "Source System Bal," then the calculation is ("GL Balances" - "Source System Bal")/"Source System Bal"
    If the variance is from the "GL Balances," then the calculation is ("Source System Bal" - GL Balances")/"GL Balances"
    You have ("GL Balances" - "Source System Bal")/"GL Balances" so do you know what you are measuring? Make sure you get this part right first. Now on to the issue itself.
    This is the point of confusion with some I think: you want the individual rows of the "% Variance" column to display the +actual+ variance, positive or negative, but in just the total at the bottom, you want the "% Variance" to reflect the "absolute values of the differences, summed, and then divided by the GL Balances."
    You can't have two different calculations on the same column like that, one for the rows and a completely different one for the total.
    Here's a workaround. Uncheck the "totals" for the pivot table completely and just show the rows. (Make sure you change the name of the "Variance" column to "Difference" or something similar.)
    Now create another pivot table view, but take out all the attributes so the measures sum up. Add an additional column called "ABS % Variance" and make this calculated column (do this in Criteria in the fx of a "dummy column"):
    (ABS("GL Balances" - "Source System Balances")/"Source System Bal")*100.00
    Don't forget to change the data format to "percentage."
    Now place this pivot table view directly below the one with the individual rows. You should now have what you are looking for.
    Edited by: David_T on Sep 30, 2010 10:58 AM

  • Displaying Distinct Count as Grand Total

    Hi -
    I have a requirement where i have to show the distinct count of Transaction Numbers at the bottom of the report as Grand Total. I created a dummy column with Fx as MAX(RCOUNT(1)) and used it in Narrative view and it is showing me the total rowcount whereas i want the distinct rowcount based on Transaction number column in my report.
    Any help is appreciated!
    Thanks
    R

    Instead of using a RCOUNT you can use the COUNT(DISTINCT <Transaction Number Column>) in your column formula
    This is an inbuilt function.
    Mark if it helps..

Maybe you are looking for