Summing up the average field

Post Author: jehanzeb
CA Forum: Formula
Dear all,
how can we achive the following:
I have two fields which are created using formula. My question is how can I get the grand total of those two fields. I have tried using the formula
whileprintingrecords;numbervar myaverage;
but this doesnt work.
any ideas how to sum up the formula created fields?
many thanks
Regards

Post Author: tsamara
CA Forum: Formula
Hi,
First, are you able to sum up your fields individually at the grand total level?
Then, if I understand your issue correctly, first do Sums of both fields and at the 'Grand Total' level and create a new Average formula.
Good luck,
Tony

Similar Messages

  • Problem with summing up the currency fields

    The below is my code through which I cannot display hthe sum at the end for all the below fields please advice on the soln. Also srched in SDN the answers are bit ambigious/also tried.
    gw_fieldcat-fieldname  = 'WTGXXX'.
      gw_fieldcat-datatype   = 'CURR'.
    *  gw_fieldcat-cfieldname = 'WAERS'.
      gw_fieldcat-tabname    = 'gt_output'.
      gw_fieldcat-seltext_l  = 'Material(Transaction currency)'.
      gw_fieldcat-no_zero    = 'X'.
      gw_fieldcat-do_sum     = 'X'.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname  = 'WOGXXX'.
      gw_fieldcat-datatype   = 'CURR'.
    *  gw_fieldcat-cfieldname = 'WAERS'.
      gw_fieldcat-tabname    = 'gt_output'.
      gw_fieldcat-seltext_l  = 'Material(Object currency)'.
      gw_fieldcat-no_zero    = 'X'.
      gw_fieldcat-do_sum     = 'X'.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname  = 'WKGXXX'.
      gw_fieldcat-datatype   = 'CURR'.
    *  gw_fieldcat-cfieldname = 'WAERS'.
      gw_fieldcat-tabname    = 'gt_output'.
      gw_fieldcat-seltext_l  = 'Material(Controlling area currency)'.
      gw_fieldcat-no_zero    = 'X'.
      gw_fieldcat-do_sum     = 'X'.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname  = 'WTGXXX1'.
      gw_fieldcat-datatype   = 'CURR'.
    *  gw_fieldcat-cfieldname = 'WAERS'.
      gw_fieldcat-tabname    = 'gt_output'.
      gw_fieldcat-seltext_l  = 'Labour(Transaction currency)'.
      gw_fieldcat-no_zero    = 'X'.
      gw_fieldcat-do_sum     = 'X'.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname  = 'WOGXXX1'.
      gw_fieldcat-datatype   = 'CURR'.
    *  gw_fieldcat-cfieldname = 'WAERS'.
      gw_fieldcat-tabname    = 'gt_output'.
      gw_fieldcat-seltext_l  = 'Labour(Object currency)'.
      gw_fieldcat-no_zero    = 'X'.
      gw_fieldcat-do_sum     = 'X'.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname  = 'WKGXXX1'.
      gw_fieldcat-datatype   = 'CURR'.
    *  gw_fieldcat-cfieldname = 'WAERS'.
      gw_fieldcat-tabname    = 'gt_output'.
      gw_fieldcat-seltext_l  = 'Labour(Controlling area currency)'.
      gw_fieldcat-no_zero    = 'X'.
      gw_fieldcat-do_sum     = 'X'.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname  = 'TOTAL1'.
      gw_fieldcat-datatype   = 'CURR'.
    *  gw_fieldcat-cfieldname = 'WAERS'.
      gw_fieldcat-tabname    = 'gt_output'.
      gw_fieldcat-seltext_l  = 'Total(Transaction currency)'.
      gw_fieldcat-no_zero    = 'X'.
      gw_fieldcat-do_sum     = 'X'.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname  = 'TOTAL2'.
      gw_fieldcat-datatype   = 'CURR'.
    *  gw_fieldcat-cfieldname = 'WAERS'.
      gw_fieldcat-tabname    = 'gt_output'.
      gw_fieldcat-seltext_l  = 'Total(Object currency) '.
      gw_fieldcat-no_zero    = 'X'.
      gw_fieldcat-do_sum     = 'X'.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname  = 'TOTAL3'.
      gw_fieldcat-datatype   = 'CURR'.
    *  gw_fieldcat-cfieldname = 'WAERS'.
      gw_fieldcat-tabname    = 'gt_output'.
      gw_fieldcat-seltext_l  = 'Total(Controlling area currency)'.
      gw_fieldcat-no_zero    = 'X'.
      gw_fieldcat-do_sum     = 'X'.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
    thanks in advance.

    Try passing datatype = 'DEC'.

  • Summing up the report fields

    Post Author: jehanzeb
    CA Forum: Formula
    Afternoon all,
    Just wondering how can you summarise a report field. I have the total number of jobs field which displays the total number of jobs any person has done at any one time. Now in the report I want to add up all the jobs which has been done by all users.
    Example:
    Name - Total Jobs
    James- 10
    Andrew-11
    Total = 21
    The above example shows the total number of jobs both (James and Andrew) performed.
    How can I achieve this?
    *I  have tried the formula field - however, it says "This field cannot be summarised".
    Formula used " DistinctCount ({#Total Jobs}) "
    Please help!
    Many thanks
    Regards
    Jehanzeb

    Post Author: jehanzeb
    CA Forum: Formula
    Not to worry I have resolved the issue.
    I had to create the summary (E) type icon and choose the fields to summarise the report field. Sometimes you miss obvious things!! :-D
    anyhow it has been fixed so closing this thread.
    Regards
    Jehanzeb

  • Dynamically summing up the numeric fields in ALV output

    Dear all,
    I had report which contains of the stock overview for a particular date based on materials. I am having the fields as
    Plant Storage location Quantity
    HC01 H14f   12       
    Hc01 H1w   13       
    Whenever the layout is selected as
    Plant and Quantity  . i have to get the output as
    HC01 25  
    But if the option is based on storeage location
    H14F  12
    H1W  13
    One thing the layout will be selected in the output of alv only the user will not run the report again.
    Is there any option to this

    Hi Shreehari,
    As per i understand your question u want  sum based on a particular field.
    For that you first select the numeric filed for which you want sum and click on sum tab on screen .
    After that select the field based on which you want subtotal.
    Now beside Total tab there will be sub-total , just click on that and you will get the ouput in your desired form.
    Hope it will help you.
    Regards,
    Ashish T.

  • Output in alv -- sum on the particular field

    Dear Freinds,
                     I have developed a report using a ALV grid . The output i having the fields
    as
    orgunit        orgdesc  count    name    salary      total salary.
    1234          test1                    raja       100          1200
                                         2     rama      200         2400
                                                             300         3600  -> i want count 2 in this line
    1235          test 2             1    rana       500         6000
                                                             500          6000 -> i want count 1 in this line
    Can i give the Count 1  and 2   in the same row where the   Totals --- 500 and 6000
    and 300 and 3600  are being displayed int he above row ?
    the user says he want to have the count in the down along witht he total's lline
    the count is not a now a currency field i tried to sum it is not summing because it is
    NUM data type.
    As per the above data(sample data) we can see that Orgunit(1234) is having two employees  hence the count was two .  For the Orgunit(1235) we have only one employee the count was only one . Nowe my question is can i give the  counts 2 in the first row and the count 1 in the second rown can give along with the total.........line ...
    if so what i can do the change in the field cat.
    When iam using in my field cat  for  getting the output as above
    CLEAR ls_fieldcat.
      ls_fieldcat-col_pos      = 0.
      ls_fieldcat-fieldname    = 'ORGUNIT'.
      ls_fieldcat-seltext_l    =  text-015.  "'Orgunit'.
      ls_fieldcat-key          = 'X'.
      ls_fieldcat-key_sel      = 'X'.
    ls_fieldcat-no_out       = 'X'.
      APPEND ls_fieldcat TO fp_i_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-col_pos      = 1.
      ls_fieldcat-fieldname    = 'ORGTEXT'.
      ls_fieldcat-seltext_l    = text-016.   "'Orgdesc'.
    ls_fieldcat-no_out       = 'X'.
      APPEND ls_fieldcat TO fp_i_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-col_pos      = 2.
      ls_fieldcat-fieldname    = 'COUNT'.     ---This is data type Numc
      ls_fieldcat-seltext_l    = 'H.Count'.
      ls_fieldcat-outputlen    = 4.
      ls_fieldcat-do_sum       = 'X'.   -
    > it is not getting summed up
    ls_fieldcat-datatype    = 'NUMC'.
      APPEND ls_fieldcat TO fp_i_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-col_pos      = 3.
      ls_fieldcat-fieldname    = 'STAFFNAME'.
    ls_fieldcat-no_out      = 'X'.
      ls_fieldcat-seltext_l    = 'Name'.
      APPEND ls_fieldcat TO fp_i_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   = 'SALARY'.
      ls_fieldcat-seltext_m   = 'Salary'.
      ls_fieldcat-col_pos     = 4.
      ls_fieldcat-outputlen   = 17.
      ls_fieldcat-do_sum      = 'X'.
      ls_fieldcat-datatype    = 'CURR'.
      APPEND ls_fieldcat TO fp_i_fieldcat.
      CLEAR  ls_fieldcat.
      ls_fieldcat-fieldname    = 'TOTAL'.
      ls_fieldcat-seltext_m    = 'Total Salary'.
      ls_fieldcat-col_pos      = 5.
      ls_fieldcat-outputlen    = 17.
      ls_fieldcat-do_sum       = 'X'.
      ls_fieldcat-datatype     = 'CURR'.
      APPEND ls_fieldcat TO fp_i_fieldcat.

    Dear Kiran,
    iam seding the alv output which i got can you please correct my code
    where i can give .........since my basic question was the Count which iam
    getting in the below  is 2 (data type NUM4) how can i do sum on this 2 or subtotal??
    i want  the count 2  to come in the total....line  only ..can you please let me know what is the parameter i have to use ........i couldnt find the
    Aggregation in my tool bar...
    orgunit orgdesc count name salary total salary.
    12345    test             raja 100
    space   space      2 rama 200 
    300  -> i want count 2 in this line
    1235 test 2 1 rana 500 
    500 6000 -> i want count 1 in this line
    Can i give the Count 1 and 2 in the same row where the Totals --- 500 and 6000
    and 300 and 3600 are being displayed int he above row ?
    the user says he want to have the count in the down along witht he total's lline
    the count is not a now a currency field i tried to sum it is not summing because it is
    NUM data type.
    As per the above data(sample data) we can see that Orgunit(1234) is having two employees hence the count was two . For the Orgunit(1235) we have only one employee the count was only one . Nowe my question is can i give the counts 2 in the first row and the count 1 in the second rown can give along with the total.........line ...
    if so what i can do the change in the field cat.
    When iam using in my field cat for getting the output as above
    CLEAR ls_fieldcat.
    ls_fieldcat-col_pos = 0.
    ls_fieldcat-fieldname = 'ORGUNIT'.
    ls_fieldcat-seltext_l = text-015. "'Orgunit'.
    ls_fieldcat-key = 'X'.
    ls_fieldcat-key_sel = 'X'.
    ls_fieldcat-no_out = 'X'.
    APPEND ls_fieldcat TO fp_i_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-col_pos = 1.
    ls_fieldcat-fieldname = 'ORGTEXT'.
    ls_fieldcat-seltext_l = text-016. "'Orgdesc'.
    ls_fieldcat-no_out = 'X'.
    APPEND ls_fieldcat TO fp_i_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-col_pos = 2.
    ls_fieldcat-fieldname = 'COUNT'. ---This is data type Numc
    ls_fieldcat-seltext_l = 'H.Count'.
    ls_fieldcat-outputlen = 4.
    ls_fieldcat-do_sum = 'X'. -
    > it is not getting summed up
    ls_fieldcat-datatype = 'NUMC'.
    APPEND ls_fieldcat TO fp_i_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-col_pos = 3.
    ls_fieldcat-fieldname = 'STAFFNAME'.
    ls_fieldcat-no_out = 'X'.
    ls_fieldcat-seltext_l = 'Name'.
    APPEND ls_fieldcat TO fp_i_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-fieldname = 'SALARY'.
    ls_fieldcat-seltext_m = 'Salary'.
    ls_fieldcat-col_pos = 4.
    ls_fieldcat-outputlen = 17.
    ls_fieldcat-do_sum = 'X'.
    ls_fieldcat-datatype = 'CURR'.
    APPEND ls_fieldcat TO fp_i_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-fieldname = 'TOTAL'.
    ls_fieldcat-seltext_m = 'Total Salary'.
    ls_fieldcat-col_pos = 5.
    ls_fieldcat-outputlen = 17.
    ls_fieldcat-do_sum = 'X'.
    ls_fieldcat-datatype = 'CURR'.
    APPEND ls_fieldcat TO fp_i_fieldcat.

  • How can I calculate the sum of the text fields?

    I'm trying to use a Flash form that has 40 text fields where
    the user will enter numeric values. I want to add one field that
    will show the total of all those values as the user enters them in.
    I have tried the following, but as soon as I add Val(Trim(...))
    around the current amount to make it numeric, it doesn't update as
    I type anymore. If I take that out, I get an error that it can't be
    converted to a numeric value. Any suggestions?
    Thanks,

    If you want to do your calculations as the data is being
    entered, you'll have to write some actionscript to do it on the
    client. cfcode runs on the server.

  • 2 sums on the same field??

    hi
    I need a special request to do that:
    source :
    date price type
    01/01/05 1000 credit
    02/01/05 500 credit
    02/01/05 200 debit
    01/01/05 2000 debit
    01/01/05 3000 debit
    01/01/05 12 credit
    02/01/05 12 credit
    result wanted:
    date credit debit
    01/01/05 1012 5000
    02/01/05 512 200
    i can't find this request.
    I need a request in SQL without function like decode of Oracle
    Thx for help

    create table t(d date, n number, t varchar2(40));
    alter session set nls_date_format='DD.MM.RR';
    insert into t values (to_date('01/01/05'),1000,'credit');
    insert into t values (to_date('02/01/05'),500,'credit');
    insert into t values (to_date('02/01/05'),200,'debit');
    insert into t values (to_date('01/01/05'),2000,'debit');
    insert into t values (to_date('01/01/05'),3000,'debit');
    insert into t values (to_date('01/01/05'),12,'credit');
    insert into t values (to_date('02/01/05'),12,'credit');
    select d,
        sum(n*instr(t,'debit')) debit,
        sum(n*instr(t,'credit')) credit
    from t
    group by d;
    D             DEBIT     CREDIT
    01.01.05       5000       1012
    02.01.05        200        512

  • Sum of Average Field

    Post Author: jehanzeb
    CA Forum: Crystal Reports
    Hello all,
    I am wondering how can you get a grand total of "Average". I have a field in the report with Average per day per lense. Now at the end of the report I would like to show the grand total of all those averages.
    Example:
    Average Per day
    2.00
    3.00
    1.50
    At the end of the page (footer) it should show grand total of 6.50.
    How can I achive this?
    Help pleaseeee
    I have tried sum, count, distrnt count etc but none seems to be working (tried the summary function key as well).
    Regards
    Jehanzeb

    Post Author: jehanzeb
    CA Forum: Crystal Reports
    Morning Khalil,
    Firstly thanks for the kind reply. I have tried your explained method but unfortunately it didn't work, infact it has changed the values to 1.00 all the way.
    Example -
    Whileprintingrecords;Global Numbervar FAvg:=0; ( This stayed at it is and has been inserted onto the header - upon initialisation it is shown as 0 which is fine).
    Whileprintingrecords;Numbervar FAvg;FAvg := FAvg+ {lab_rework.rework_qty}; ( The rework qty is the field which needs to be averaged - example  from 01/05/2008 to 02/05/2008 there were 3 lenses which were reworked, so the average should be 1.5 per lense per day. However, using your formula it shows 1.00)
    Whileprintingrecords;Numbervar FAvg; (This is the grand total of whatever the average field shows however this is showing 1.00 as well even though the records are showing 1.00, in theory this should add up all those 1.00s and should show 10.00 which it isnt.)
    I have tried using the built in average running total but it doesnt seem to work as it calculates the average of the first day and not all days. For example when I entered the date range from 01/05/2008 to 02/05/2008, it shows the average of the 01/05/08 day and not the total average of both days hence showing only 1.00 as it calculating only one day. This however should calculate the average of the days I enterd into the parameters i.e. according to the date range
    how can I achive the expected results (where it shows the average of all the lenses reworked according to the date range)?
    Many thanks
    Regards
    Jehanzeb

  • How do I calculate the average of ONLY the populated fields?

    I'm working on an Adobe form to streamline the process of summarizing course evaluations.  To protect the anonymity of the students, instructors with 10 or fewer students are given a typed summary of the evaluation results.  On the first half of the evaluation, the students are asked to rate a series of statements from 1-5.  Three of these are highlighted on the summary form with the average response. 
    I've already set up the form with 10 unique boxes for each question and an 11th box which calculates the average.  Each field is named according to the question number and the student's "number" (I arbitrarily gave each student a number so that each field would be unique):
    i.e. #1. Questionquestionquestion.  Q1S1  Q1S2  Q1S3  Q1S4  Q1S5  Q1S6  Q1S7  Q1S8  Q1S9  Q1S10  1AVG
    The problem, of course, is that no matter how many students were actually in the class, the AVG field will always be calculated based on a group of 10...which isn't accurate or fair to the instructor.  I thought about just changing the form and removing the unused fields from the equation each time I make up a new summary, but the point of creating a form was to make it as quick and easy as possible to bang these things out... Plus, some of my coworkers might be using the form from time to time and I'd have to explain what they have to do and if they don't have Adobe Acrobat then they can't actually make the changes and blah blah blah...it just gets ridiculous really quickly!
    So anyway, I tried reading some other posts for similar questions in an attempt to figure out a custom calculation script for myself, but I just couldn't focus on it.
    I was hoping someone could explain how to write a custom calculation script that will omit any fields which are left blank... Or, even better...is anyone willing to write it for me?  At least just an example of the first guy, cause I could probably figure out how to get all the other ones from there.
    Thanks.

    In formcalc the function Avg will calculate the average of only the fields with a value in them. So you would would put in the calcuate event of the average field:
    $ = Avg(Q1S1,Q1S2,Q1S3,Q1S4, etc)

  • ALV SUM for non numeric fields.

    Hello Gurus,
    I have a requirement where i have a alv output and i have a check field of char 1 length...and it displays X as the output. Now i need to have X at the sum line at the end.is there is any possibility with the fieldcatalogue.

    Hi
    U can not do sum for char type fields,it will only possible for numaric fields.
    This u can do by program,after populating the output data,do the sums for the required fields in program and append that to output table as last record.Display the last row with differant color.
    Regards,
    Raghu/

  • ALV List Display - Is it possible to sum up the subtotal values of  field

    Hi Experts,
    We hav a requirement to do subtotals of the price field for each unique PO Line item, and also to sum up the subtotal values ie. only the subtotal values needs to be added irrespective of the repetation of the po line items in the report.
    PO Number                  PO Item              Price
    XXXXXXXX                 10                      20
    XXXXXXXX                 10                      20
      Subtotalled                                          20
    YYYYYYY                 10                      10
    YYYYYYY                 10                      10
      Subtotal showing                                10  
    We want the total of price to be           30 ie (Subtotal value of XXXX, 10 = 20 and YYYYY,10 = 10 ) but currently do_sum is been used in the fieldcat of the report which displays all the occurances of the record... = 60(202010+10)
    Kindly help asap.
    Thanks,
    Rosy

    Hi rosy,
    the question pops up to why you have duplicates in the display table. If you
    DELETE ADJACENT DUPLICATES FROM
    the output table, everything should be fine.
    Regards,
    Clemens

  • How to display Average, not Sum, in the "Overall Result" row of a report?

    Every report I look at or execute that has an Overall Result row always shows a total(sum) of all the cells in the column.  I recently came across one that shows the average of all the cells in the column and after looking at the query in BEx Query Designer 7.0 and BEx Analyzer 7.0 I cannot seem to find out where to set this.  All of the Key Figures are listed as "Nothing Defined" in the Calculations tab which is exactly what they should be, but where can I set that yellow-highlighted Overall Result row to calculate an average, not a sum?
    Example can be found in this picture:
    http://img87.imageshack.us/img87/6757/pic1yp.jpg
    Thanks for the help!

    My issue was that I was setting my KF's to 'Calculate Result As: Average' within the Query View that I was editing but the change was not showing on my screen when I have that View opened within the Analyzer.  Infact, it still is showing totals.  But when I execute my Web Template that references this Query View, the graph does display the result row using Averages.  Seems to just be a visibility bug, but it is now working.
    Thanks for the reminder about that property KP,
    Scott

  • How do I make a form field validate that it is the sum of two other fields?

    Hi there,
    I am creating a form, and I would like one of the fields to validate by making sure that this field is the sum of two other fields in the form.  Does anyone have any ideas on how to go about this?  I know I'll need to run a custom validation script, but I'm not sure where to begin - I've never done one for validation before.
    Thanks for any help!

    OK, here's a sample script that I hope will clearly demonstrate the general approach. It is intended to be the custom Validate script of the field that the user enters that value that is supposed to be equal to the sum of the two others.
    // Custom Validate script
    (function () {
        // Get the value that the user entered
        var sVal = event.value;
        // If it is blank, do nothing else
        if (!sVal) {
            return;
        // Convert string to a number
        nVal = +sVal;
        // Get the values of the fields, as numbers
        var v1 = +getField("text1").value;
        var v2 = +getField("text2").value;
        // Add them together, rounding to two decimal places, converting to number
        var sum = +util.printf("%.2f", v1 + v2);
        // Compare entered value to the sum of the other two fields
        // Alter the user if they do not match
        if (nVal !== sum) {
            app.alert("The value you entered does not equal the sum of text1 and text2. Please correct.", 3);
            // If you want the entered value rejected, include the following
            event.rc = false;
    Replace "text1" and "text2" with the actual field names.

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

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

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

  • PM Reports: Need to find the sum of a particular field in the output.

    Hello Experts,
                          I have an issue. I have developed the report to calculate the power per ton. It is PM module.
    Input is : DATE & Measuring Point.
    Output required is : For a particular date , What is the power consumed per ton.
    Its is calculated by the formula Power consumed per day /  Production.
    I have multiple entries for production ( because different material are used )  per date and a single entery for power (because power is taken as total power consumed per day)
    Hence im getting the output as
    For example:
    date                power            production         power/ton
    01.03.2011      5000                    100                  50.00
    01.03.2011      5000                      50                 100.00
    01.03.2011      5000                      25                 200.00
    01.03.2011      5000                      75                  66.66
    The desired result is
    date                power            production         power/ton
    01.03.2011      5000                    250                  20.00
    I need to sum the production field.
    How can I achieve this ?
    Please help.

    Hello
    Rotate the loop and use event so on change just clear the variable based date condition .
    take 2  temp variable for summation
    clearing the total and moving value on permanent variable means modifying the itab.
    loop at .
    *Clear
    on change <datefield>.
    modify itab from wa  transporting <field name> .
    clear <total field>.
    endon.
    *Total
    t_prd  = t_prd + production..
    t_power = t_power + power .
    endloop.

Maybe you are looking for