Keeping a running total

I have to create a programme in java where you input type of currency, exchange rate, amout of currency. then convert it to GBP and print the answers. This bit I have done. A loop is also needed to keep inputting amounts of the same currency and keep a running total of amount input.
The programme runs fine, and I can get the total number of transactions, but I am having problems getting the amount of currency inputted to add. I created a new variable for this but cant get it to work, it will either print out 0 or the last amount inputted, depending what I do.
Any help would be appreciated. I know its probably very simple but I have spent so long on this I think I have lost my way.

You need to create the summation variable before the loop and use it inside the loop, so that it doesn't keep getting created (and the data held in it erased) with each iteration of the loop.
If this is not clear, then post your code.
Good luck!

Similar Messages

  • Is it possible to create an invoive that keeps a running total in one column and in another column keep total of monies spent from a starting amount of funding?

    Is it possible to create an invoive that keeps a running total in one column and in another column keep total of monies spent from a starting amount of funding?

    Hi Sara,
    Many thanks for your reply.  We just brought Adobe Acrobat XI Pro complete
    with Adobe Forms Central, My manager asked whether I could use the forms
    part to create a summary tracking sheet for all of our contracts.
    Having looked at it I could see how to create a table that in the first
    column deleted costs from a starting fund, and in the last keeps a running
    total of all monies spent.
    I agree, Excel does seem to be much better suited to the task.  I was try
    trying to comply with her request
    Regards,

  • Keeping a Running Total for Formula fields

    Post Author: khanh
    CA Forum: Formula
    I've been messing around for the past couple of days trying to figure out what the best approach for my problem.  So here is what I'm trying to accomplish.  I have multiple rows which contains sums for different columns and one of the columns contains the maximum of the sums. 
    For example:
    ROW 1           SUM (A)             SUM(B)             SUM(C)            MAX(sum(a), sum(b), sum(c))<----
    Formula Variable 1
    ROW 2           SUM (A)             SUM(B)             SUM(C)            MAX(sum(a), sum(b), sum(c))<----
    Formula Variable 2
    ROW Total      SUM (1A2A)     SUM(1B2B)     SUM(1C+2C)     Result of Row 1 + Result of Row 2
    What I did was create a formula variable that evaluates the maximum of those rows and have a summary row, that keeps a running total.  I'm not sure how to store the result of that formula variable in the running total since the formula variable isn't an option to select.  Does anyone have a suggestions if this is a good approach or if there's another way to approach it?

    For each value you enter into scores.text, end it with a
    +"\n"
    as in...
    scores.text = String(1100) + "\n";
    scores.text += String(2200) + "\n";
    scores.text += String(1500) + "\n";

  • Cumulative total - how to have a footer cell give running total

    I'm working on a gas mileage spreadsheet. One column shows how many miles I went between gas fill ups. I'd like the footer cell in that column to show the running total. I'm running into a problem with the empty cells - they're causing a red triangle error in the footer cell. What's the formula to keep a running total of a set of cells, but ignore any blank cells?
    Thanks,
    Don

    Hi Yvan,
    Thanks for your response. The cells in C are output from other formulas. I used =SUM(C) for the cell (which happened to be the C column, by the way) and got the red triangle error. Is there a way for the footer cell in C to disregard the embedded formulas and take the output of each column cell instead, and get a running total of that?
    Thanks,
    Don

  • How can implement running total in oracle forms

    I want to implement a running total in oracle form
    like
    100 100
    300 400
    200 600
    500 1100
    200 1300
    100 1400
    PROCEDURE calculate_srno IS
    current_rownum     integer:=:System.Cursor_Record;
    starting_srno integer:=:rs_1;
    last_rownum integer;
    BEGIN
         last_record;
         last_rownum:=:system.cursor_record;
         go_record(1);
         FOR counter IN 1..last_rownum LOOP
              :sum_1:=:rs_1;
              :rs_1:=:sum_1+:rs_1;
         --     :offered_srno_to:=starting_srno;
              if last_rownum=:System.Cursor_Record then exit;
              end if;
         END LOOP;
    END;
    it is not working after want to insert between in the table

    Why write code for this? Oracle Forms 10g has Calculated/Summary fields that will do this for you without the need of writing any PL/SQL.
    Simply add a non-table item to the data block with the item you want to keep the running total for. Then change the following properties of the item:
    Data Type: Number
    Calculation Mode: Summary
    Summary Function: Sum
    Summarized Block: <Your Data Block>
    Summarized Item: <Your Block Item>
    Number of Items Displayed: 1 (if your item is in a Multi-Record (Tabular) layout else you don't need to change this property.
    You will also need to change the following property of the block: Query All Records: Yes
    If changing the Block's "Query All Records" property causes your form to be too slow because of the number of records in your block, then you could keep a running total manually by using a combination of the Post-Query and When-Validate-Item (WVI) triggers. If your block does not allow data entry, then you could do this with just the Post-Query trigger. For example:
    BEGIN
      /* This code sample assumes you have added a non-table item */
      /* to your block called SUMMARY.  */
      :YOUR_BLOCK.SUMMARY := :YOUR_BLOCK.SUMMARY + NVL(:RS_1,0);
    END;If your block allows data entry, then you would add the following to your existing WVI trigger.
    BEGIN
      /* Perform your data entry validation logic first... */
      IF ....
      ELSE
        ...Validation is successful...
        :YOUR_BLOCK.SUMMARY := :YOUR_BLOCK.SUMMARY + NVL(:RS_1,0);
      END IF;
    END;Hope this helps.
    Craig...

  • Running totals by field

    I am trying to create a recap document for a survey. Where you enter the results in individual fields....the same field keeps a running total after entering each number....i did this first in excell.....the field code was RT=0 for excell.....am lost how to make this happen in adobe livecycle design....please help someone.........

    Hi,
    If I got it right, you would like to use 'Record Sort Expert' with running total fields. In this case, you cannot sort by running total fields using 'Record Sort Expert' because of the way Crystal Reports processes the report (three-pass reporting method).
    When a report is created, the 'three-pass reporting method' should be taken into consideration to avoid inconsistencies.
    Further information on this reporting method is available in Crystal Reports Online Help (From Crystal Reports, press F1).
    I hope this helps,
    Selenia

  • Account 'Running Total' question

    I have a request where an Account needs to keep a 'running total'.  I don't think Time Balancing will work.  Requirement is the account would just growing each month, then Jan of Year two equals Dec from Year one and so on......  Does DTS handle this?  Not quite sure DTS keeps running tally forever....
    Thanks for any input.

    Using DTS to achieve a rolling balance across Years would likely not work in a Planning app.  This is because Planning requires two separate time-related dimensions ("Years" and "Period").  Only one of these can be tagged as "Time", which is the dimension that DTS uses.  Therefore, I can't see how you would get DTS to cross years AND roll up data within Periods.
    From where is your data sourced?  Is it from a source system (like a GL)?  If so, just send the rolling balance from there.  Is it entered by users, and the rolling balance must be calculated?  If so, I'd consider having the users enter the activity (delta from period to period) and develop a calc to perform the rolling balance across years and months, perhaps in a separate account.  You'll need a beginning balance to get this started.
    Hope this helps,
    - Jake

  • Financial Reporting Studio - Running Total

    I am trying to build a waterfall / step chart in Financial Reporting Studio to visualize large movements between prior year and current year profit by profit type. For it, i require a 'running total' of profit type movement. I burst the profit type dimension out on row 2 and i want to keep a running total formula calculation
    e.g.
    Last Year
    This Year
    Movement
    Total Profit
    [Profit Type].Level1 drilldown
    Total  Profit
    I want to keep a running total of the movement in Row 2. How can i do this?

    Insert Formula Row and give it formula.

  • Keep one record during running total

    Post Author: masto123
    CA Forum: General
    Hi there,
    i am new to crystal so please bare with me.
    I have a field which displays a part number and a running total on the qty on hand. I wish to only display one record when the running total reaches a negative figure. See below on how the data looks like.
    ABC(PART ID)    4
    ABC    2  (WISH TO SUPRESS)
    ABC    0  (WISH TO SUPRESS)
    ABC    -2   (ONLY WISH TO DISPLAY THE RECORD WHEN THE PART(ABC OR DBD) GOES NEGATIVE AND ONLY SHOW THAT RECORD.
    ABC    -4   (I WISH TO SUPRESS RECORDS APART FROM THE FIRST RECORD THAT GOES NEGATIVE)
    DBD    6
    DBD    3
    DBD    0
    DBD    -3
    DBD     -6
    thankyou

    Post Author: Charliy
    CA Forum: General
    You'll probably need  variables so you can look at the value before you subtract the quantity from it.  It's not clear to me from your example where the initial quantity comes from. 
    Basically your formula needs to do this:
    IF the current balance is positive and subtracting the new transacation does not make it negative then just subtract
    IF the current balance is positive and subtractine the new transaction makes it negative then subtract and set print flag to YES
    IF the current balance is negative then set the print flag to NO
    Use a Print suppress formula that loks at the print flag variable.

  • How do I use a running total within a selection formula?

    I am developing a report within Crystal Reports 2008.  My goal is to identify any accounts that have zero usage for at least six months in this current year.  I have account number, meter size, read date, usage, and a running total/subtotal by account.
    Here is what the data looks like in the report
    ACCTNO     METER SIZE   READ DATE/TIME               READ_USAGE    Counter
    001022-05                    
    001022-05     2.00              9/28/2009  9:42:00 AM      0.00                     1
                                                                                    1
    001110-09               
    001110-09     2.00             3/2/2009  9:54:13 AM         0.00                      1
    001110-09     2.00             3/26/2009  1:32:28 PM        0.00                      1
    001110-09     2.00             4/27/2009  11:02:11 AM     0.00                      1
    001110-09     2.00             5/27/2009  1:13:53 PM        0.00                      1
    001110-09     2.00             6/19/2009  11:41:20 AM     0.00                      1
    001110-09     2.00     9/1/2009  8:13:25 AM         0.00                      1
                                                                                    6
    My report shows all accounts that have zero usage.  I want to filter the report to only show the accounts that have at least six zero usage reads.  I thought I could add a running total, sum it, and filter the data by using the selection formulas.  Unfortunately I keep getting an error message saying "this field cannot be used becuase it is being evaluated later."  Any help would be appreciated.  This is the first report I have created using crystal.
    Edited by: smwdrw2 on Oct 28, 2009 4:29 PM

    You could Conditionally suppress the account numbers where your running total is less than 6
    You will probably have to put your account number summaries in the group footer, instead of the header.
    Then:
    go to the section expert, click on the group footer for the account number, on the right, next to the word "Suppress" click on the box that says "X-2". In the formula put
    IF<6 then True
    Save and close
    The only way this would not work for you is if you have some sort of grand total that you don't want to include the other groups in.

  • Running Total Changes?

    Post Author: cjsmile2106
    CA Forum: Formula
    Hello Everyone
      I have a weird problem.  I have a report that has three groups.  In each group I have manual running totals.  I would like to take a manual running total that I have in Group 2 and subtract it from my Group 3 manual running total.  However when I attempt this for some odd reason by manual running total from Group 2 is not subracting that same number.  For example:
    Group3
    5 - 7 = -210 - 7 = 315 - 7 = 820 -7  13
    Group 2
    -7
    Its not doing that however, it seems to be subracting some random numbers instead of the Group 2 total.  Thank you for your assistance!

    Post Author: sharonmtowler
    CA Forum: Formula
    make sure you do not have repeat group header  or keep group together checked, causing weird mrt. make sure the variable name is not used in another variable name. you may need to place the formula that is subtracting the display formulas below the other to get an accurate set, and use whileprintingrecords

  • Running Totals, is there a method for this

    Hello, I am racking my brain out trying to figure out how to do a running total based on each succeding input by the user. It goes like this, if a person has more then x, then it does an if else statement based on the value inputted, else something else. The problem that Im having is trying to figure out how to keep the total in and add it to each successive input, and allowing the whole thing to be ended with a while ! =1.
    Any suggestions would be so greatly appreciated.
    Best Regards,
    MT

    I Given below the solution for whatever understand from the question given below.
    For example if you run
    C:>java Tot 121 150 you will get the following output.
    Total No of Inputs : 2
    The Input value1=121
    The Input value2=150
    Total = 271
    public class Tot{
         public static void main(String args[]){
              System.out.println("Total No of Inputs : "+args.length);
              int total = 0;
              for(int pos=0;pos<args.length;pos++){
                   System.out.println("The Input value"+(pos+1)+"="+args[pos]);
                   total = total + Integer.parseInt(args[pos]);
              System.out.println("Total = "+total);
    Darma

  • How to Summarized Running Total and Formula ????

    Post Author: ryan_r
    CA Forum: Crystal Reports
    Hi my name is Ryan, I want to ask something. I have build a report
    that contains Running totals and Formula. What I want to do is I want
    to use subtotal and Summary field for the running total and Formula,
    but I can find the field when I click the dropdownlist in the Subtotal
    dialog box or summary field for the running total and the formula. Is
    there any way that I can use subtotal or summary field for Running
    Totals and formula, I do need some help guys, Thanks. FYI: I use Visual Studio.NET 2003; ASP.NET(C#).regards

    Post Author: ryan_r
    CA Forum: Crystal Reports
    Hi kcheeb, thanks for your advice but it doesn't work sorry. By the way maybe I can explain you more of twisted situation.I have updated my report,
    so im not using runningtotals any more, I'm using summary field and
    formula which are;-the summary field is "Sum of SuspenseVoucher.Realisation" located in Group Footer #3: SuspenseMstr.ProgramID-The formula is "@Balance_Formula" which contain:{SuspenseMstr.Budget}
    - Sum ({SuspenseVoucher.PenggunaanBudget}, {SuspenseMstr.ProgramID})
    also located in the same location as summary field above.FYI: I have three group records which are:-Group #1 : SuspenseMstr.APDate (Appearing in months e.g January 2007)-Group
    #2 : programCategoryMstr.programCategoryID (doesn't have any objects I
    just put some dashed line, the group is only for proper sorting)-Group #3: SuspenseMstr.ProgramIDwhat I want to do is:-in the Group Footer #3, I already put "Sum of SuspenseVoucher.Realisation" and "@Balance_formula"-in
    the Group Footer #2, I want to put Summary of Budget but there's a
    problem in here too, in the budget field there are some data are
    conditionally suppressed. I already tried to put some summary field but
    the summary operation wasn't like what I wanted. What I wanted was the
    sum only evaluate the data that appeared in the report not the
    suppressed, but in the summary the suppressed data keep evaluated. And
    in this location I also want to put Summary of "Sum of
    SuspenseVoucher.Realisation" and the Sum of the @Balance_formula.-
    in the Group Footer #1, I want to add some Summary of "Sum of Budget"
    (which I already explained that this operation has a problem) and I
    also want to put the Sum of "Summary of Sum of
    SuspenseVoucher.Realisation" and the Sum of "Sum of @Balance_formula"-And in the Report Footer I want to add some Grand Total from all of the evaluation above.So
    there are my problems, quite much I would say. I hope this explanation
    helping all of you guys to solve my problem, thanks for spending your
    valuable time for me. This matter is really important for me 'cause I
    want to learn something new from all of you experts as I'm still a
    "toddler" in this situation and also because I work in this field, so a
    BIG thank you for all of you guys out there. Best Regards.

  • Running Totals Maybe?

    I am fairly new to Crystal Reports and Running Totals. I have a group setup that is based on the number of days a loan is late. For example, I have three buckets (30 Days, 60 Days, 90 Days). In setting up the group, I put the group in specific order and decided to exclude the other loans that are less than 30 days. I am trying to get a total $ amount of all the loans instead of just the loans in the buckets. I have searched forums and a Crystal 2008 book trying to figure this out. I tried using a Running Total with the Running Total expert but it is still giving me the same grand $ total that I have for the groups I selected. Any ideas? I am bit confused as to the multipassing of the data. Should I keep the groups setup the way I have them or use the select expert (etc).
    Thanks, I am a newbie.

    i suggest manual running totals, more accurate and if you have duplicate values the summary option will duplicate the data
    create 3 formuls
    i reset
    whileprintingrecords;
    numbervar x:= 0;
    this gets placed in the group header
    calculate
    whileprintingrecords;
    numbervar x:= x + field or formula;
    this gets placed next to the field or formula you want calculated
    display
    whileprinitngrecords;
    numbervar x;
    x
    this gets displayed in the footer of where the reset is (header)
    using manual running totals, if you have data on the report you dont want included you can create a formula that will only calc based upon only what should be included.

  • Associate a record name with a running total in Report Footer

    Please Help!
    I have a report that returns records for the most recent order recieved by vendor.
    The page header displays Vendor, Contact, Order #, and date
    I did a group by Vendor
    I used a running total on the order date
    with a summary of minimum
    that evaluates on change of group
    Reset never
    This returns the last order date for the vendor with the oldest order
    How can I get the vendors name that is associated with the oldest order date to display in the Rport Footer.

    Please follow the following steps: I tested it and it works.You dont need to use running total.
    1. Add the Vendor,Contact,Order #, Order Date to Details Section (u can delete them if not needed from details section)
    2. Create a Group on Vendor.
    3. Add a Summary  i.e. Minimum(Order Date)
    4. Copy this summary to Group Header if you want or just let it be in the Group Footer Section
    5. Add a SubReport in the Report Footer Section.
    6.The Subreport Should be based on the Command like:
    SELECT `Orders`.`Customer ID`, `Orders`.`Order Date`
    FROM   `Orders` `Orders`
    WHERE `Orders`.`Order Date`=
    SELECT MIN(`Orders`.`Order Date`) 
    FROM  `Orders` `Orders`)
    7. Refresh the Report and you will see that Report Footer section displays all the vendors with minimum order date along with their name.
    One more thing to keep in mind is that more than one vendor might have the same minimum order date.

Maybe you are looking for

  • What Flash Player for Flex builder 3?

    I am just getting started with Flex & hitting a lot of roadblocks. Getting files for Day 1 helped. When I try to "run" a project I get asked for Flash Player 9. I uninstalled Player 10, found Player 9 for developers, installed, but Flex still does no

  • Play counts and ratings aren't saving

    So far I've been using iTunes for a year and I haven't had any problems until now. So here goes: As far as I know this has started since I've updated to iTunes 8.2. My play counts and ratings aren't saving when I exit iTunes and start it up again. Wh

  • Why do the colors of my display change when opening applications?

    Something is causing my display look like it has a blue cast whenever I open applications like photoshop, google chrome, preview, etc. It's really annoying and it looks like absolute garbage. I'm a photographer and I can't get any work done if my dis

  • Unable to include Z service in another service

    HI, I want to call mine Z custom service from ITS template of another service. Or Include service in another Service's template . I did this but it's calling only custom service templale fields not including its logic .Mean the code i have written in

  • Maximum number of users per Front End, assuming no AV

    I know that MS recommends 80,000 user limit per pool, and 6000 per Front End server, but that's certainly going to be assuming you are using the Front End services to some degree. A/V, I'm certain, is a fair overhead. Is there any kind of idea what t