Manual Running Total won't Reset

I've created the following formulas to create a manual running total.  However, I can't get the total to reset.  Instead, the total gets added to each time the group appears.  What am I missing? 
GROUP 1 HEADER 
================
//placed this in group 1 header to reset total each time this group appears
whileprintingrecords;
shared currencyvar TotalCore;
TotalCore:=0
GROUP 2 FOOTER
============================
//placed this in the footer of next group to get total added to the TotalCore variable from above
//the fields I'm adding to TotalCore are fields summarizing the detail fields
WhilePrintingRecords;
Global CurrencyVar TotalCore;
TotalCore := TotalCore + ({@Core6-Sum} + {@CoreApp3-Sumfor#ofMos});
TotalCore
GROUP 1 FOOTER
============================
//this number accumulates for each group...I need it to reset.
WhilePrintingRecords;
Global CurrencyVar TotalCore;
TotalCore

You left out two extremely important pieces of information:  the formulas for {@Core6-Sum} and {@CoreApp3-Sumfor#ofMos}.  It is possible (from where I sit) that they are carrying the values forward...
Other than that, I don't see anything obviously wrong...
HTH,
Carl

Similar Messages

  • Running Total does not reset when group changes

    I have a manual running total for group3 that does not reset for group2
    Group2 Header (Order Status 3=Open,4=Closed)
    WhilePrintingRecords;
    currencyVar WIP=0;
    Group3 footer (Order Number)
    WhilePrintingRecords;
    currencyVar  WIP;
    WIP := WIP + {@NETWIP}
    Group2 footer
    WhilePrintingRecords;
    currencyVar WIP;
    There are no Repeat Group header on any of the groups
    Will add Group1 total when this part works.

    I am not sure if you made a typo when making your post but you are missing a colon when resetting your variable
    change from this
    currencyVar WIP=0;
    to this
    currencyVar WIP:=0;

  • Manual Running Total vs Running Total

    Morning all,
    It is some what strange to me when I try to use a formula to calculate the total jobs and when I try to use Running total to count the same total jobs. Both answers in theory should be the same however they are not. I am wondering where am I going wrong in the manual formula.
    If {despatch_summary.job_type}="FSV" then
    if {despatch_summary.order_status}<>0 then
    {despatch_summary.order_no}
    else
    0
    The above code then gets DistinctCount ({@FSV})
    The same method if I use by using Running Total it gives the correct number of jobs.
    Running Total
    field to summarize : despatch_summary.order_no
    Summary Type: DistinctCount
    Formula: {despatch_summary.job_type}="FSV" and {despatch_summary.order_status}<>0
    Reset: none
    The formula gives me 513 where as the same running total gives me 514
    Where am I going wrong?
    Strangely it is adding 1 to all of my manual running totals (1 is coming from canceled orders).
    Many thanks
    Regards

    Sastry I am adding this formula into the crosstab which is setup by Number of days. So on the column it is number of days and on the summarized field it is this formula.
    I chose Group options and clicked on DistinctCount after adding the formula into the summarized field.
    I have already tried the formula you have suggested however it doesn't seem to be affecting it.
    Apart from that what I have just done is added the Running Totals to the Summarized field which is coming up correctly however now the problem is to get their percentages.
    I have used the following code but it doesn't seem to be working.
    Whileprintingrecords;
    Numbervar g:=Currentfieldvalue;
    Numbervar h:={@TotalJobs-CanceledJobs};
    Numbervar i:=0;
    i:=((g/h)*100);
    Numbervar gTot:=gTot+i;
    if gTot > 100 then "100.00%"
    else
    totext(gTot,2)+"%"
    I know I am doing it wrong when it comes to percentages. I need to get the percentages off that Running Total (Grand Total).
    Am not sure how to acheive that either.
    Many thanks
    Regards
    Jehanzeb

  • Manual running total issue

    Hello All,
            I have written manual running total formula:
    Reset formula in group header:
    whileprintingrecords;
    numbervar sol:=0;
    Evaluation formula in detail section
    whileprintingrecords;
    numbervar sol;
    if Field_Name1 <> previous(Field_Name1) then
       sol:= sol+ Amount;
    Display formula in group footer;
    whileprintingrecords;
    numbervar sol;
    But the total doesn't seem to match, can someone help me!
    Thanks!
    Sonali

    Hi Sonali,
       For Ex:
    1) If the group is on County> U, and country has 40 detailed records.
    2) The Option " Repeat  group header on each page is checked" and a reset formula is placed in the
        group header.
    3) In one page take for example 25 detail records are printed the evaluation formula will evaluate for 25
        records. And in teh next page again the group header will be printed. This causes the reset formula
        to print again where the total becomes zero again. And the remaining 15 records will be added and
        the group footer will display that total.
    Regards,
    Vinay

  • Calculate % on manual running total??

    I have a three part manual running total that prints the final value in the report footer.  That total is based on groups of cities and time spent by each city on a project.  I'm trying to calculate the percentage of time they spent on the total project in each cities group footer.  So, of course (citytime % totalprojecttime).  However, since it's a manual running total it's calculating based on the time up until that point, so the first city is always at 100% because the manual running total and time spent by that city is always equal.  Then the next percentage is only based on the first two cities total divided by that current city, etc. so that the only city that actually has a correct percentage is the last one because it's finally calculated the totals at that point.
    I've tried various printing states (evaluate after, etc) but those aren't going to work because the total isn't done until the end.  Without doing a subreport, is there anyway to calculate that properly?

    If you can't do a simple summary to derive total time for City, then you will need to develop a hidden subreport which you place in city group header, and use that total calculate total city time. You can then use a shared variable to holding the total city time to calculate your %ages.
    Hidden subreport is a subreport will all sections suppressed and minmised so that it does not appear, it must be held in an unsuppressed section, you can section to underlay to ensure minimum space taken up.
    Ian

  • Manual Running Total

    Post Author: dbmngleaf
    CA Forum: Formula
    I'm using Crystal Report XI and I have a report where I need to supress data and show a running count for just the records that are showing on the report.  My supression works fine but the running count isn't.  I've seen that you can't use the built in running totals when you're supressing data and I seen that you can create 3 formulas to get this to work however it isn't working.
    My formulas are:
    total_init
    WhilePrintingRecords;
    numberVar overall_total:=0;
    total_calc
    WhilePrintingRecords;
    numberVar overall_total;
    overall_total:=overall_total+1;
    total_disp
    WhilePrintingRecords;
    numberVar overall_total;
    The formulas are totaling everything including the supressed records.  How do I get it to count just the records that are displaying?  Thanks for any help in advance.

    Post Author: yangster
    CA Forum: Formula
    you're almost therethe only thing you need to is change your evaluation formula, you don't have an if statement in there to tell it to ignore the records you don't want to countwhat you have right now is it will increment by 1 for every recordtotal_calc
    WhilePrintingRecords;
    numberVar overall_total;if not(whatever you are supressing on) thenoverall_total:=overall_total+1;so this will count every time the record is not supressed

  • Running totals are not resetting to zero

    I have a commission report that runs these calcs and the rep group is not restting to zero and the same for the Invdate group.
    Any suggestions?
    Group #1 InvDte
    Group #2 Rep
    Group #3 Inv #
    {@OrderDiscount} = {Invoice_Master.ORDDSC_31}*-1
    //@ratio          //invoice footer
    if {Invoice_Master.ORDDSC_31} = 0 then 1 else
        {@OrderDiscount}/ {Invoice_Master.LNETOT_31}
    //@commdiscount               // Invoice Footer
    if {Invoice_Master.ORDDSC_31} = 0 then 0 else
        Sum ({@Commission}, {Invoice_Detail.INVCE_32}) * {@Ratio}
    //Rep_Comm_Discount
    WhilePrintingRecords;            //Rep header
    currencyVar Rep_Ord_Discount = 0
    WhilePrintingRecords;          //Invoice Footer
    currencyVar Rep_Ord_Discount;
    Rep_Ord_Discount := Rep_Ord_Discount + {@CommDiscount};
    WhilePrintingRecords;          //Rep Footer
    currencyVar Rep_Ord_Discount ;

    Hi Alfredo,
    First try this:
    In design view, right click on the group where you placed the reset formula. Go to Change Group -> in the second tab, uncheck "Repeat Header On Each Page."  Now, see the results.
    If that doesn't work.  Try placing the reset formula in another group header.  My guess is you might not be placing it in the correct group.
    I hope this information proves useful.
    Regards,
    Zack H.
    Edited by: Zack H on Feb 3, 2009 3:26 AM

  • Manual Running Totals

    Below is the formula I've created but the total is 1 count higher than it should be.  The total should be 1346 and it is showing as 1347.
    whileprintingrecords;
    numbervar NotEstRt;
    NotEstRT:=NotEstRt+{@Not Established};
    Thank you for any thoughts and suggestions.
    Jen

    1) @Not Established:
         if {@SameDay vs OV} = "Not Established"
         then 1
         else 0
              1a) @SameDay vs OV
                     if {@OV Count}=0
                     then "Not Established"
                     else "Established"
                                  (This is linked to a shared numbervar fora  subreport.)
              1b) @OV Count
                   Whileprintingrecords;
                   shared numbervar OVCount;
    2) Placed in GF1
    3) I think that is the part I'm missing but haven't been successful in getting there.

  • Running totals: Custom Reset via Formula? (VS 2005)

    Post Author: PunchngMrGrumpy
    CA Forum: .NET
    Hi All,I have attached a screenshot to help make up for my inability to describe the situation I'm dealing with here.I
    have three groups within a report that currently use distinct Running
    Totals fields that Reset at the group levels that I assigned. I am
    attempting to create a single Running Totals field for all 3 groups
    that will reset depending on which Group is being calculated at the
    moment so that I don't have to have 3 separate Running Totals object
    for each and every group. I'm not sure how to do this or write this
    formula as I'm new to Crystal Reports and am used to SQL Reporting
    Services where this evaluation is automatically done for you (I was
    spoiled I guess).For example, if the Running Totals field
    control is in Group #1, I want it to reset at Group #1, and Group#2 to
    reset at Group #2, etc without having to create a field for each group.So
    basically I'm attempting to use a formula to create a Reset point (view
    screenshot for detail) that is determined by which group the data is
    being calculated in. Is this possible? I realize that it is possible by
    simply creating a new running total object for each group and telling
    it to reset on change of group specified, but this seems completely
    redundant and overly time consuming for larger reports where there are
    multiple groups and a lot of Running totals fields.I'm developing the report with Crystal Reports within Visual Studio 2005 if that helps any.I
    don't know if you'll be able to see it, but I have a screenshot link to
    explain what I'm trying to do. http://www.codeguru.com/forum/attachment.php?attachmentid=19302Thanks!

    Hi Abhilash,
    Thanks for the code, but the totals aren't right still yet.
    Also, I just noticed my running total is not functioning properly.  Count be the reason for my delima.
    Any suggestions on how to get the running total to function properly?
    What I just noticed is:
    Date               Patient          Count
    7/9/13             Patient A       7
    8/8/13             Patient B       8
    8/8/13             Patient B       8
    8/8/13             Patient C       8
    8/8/13             Patient D       8
    8/15/13           Patient E       9
    Would I be better off to do a formula vs a running total?

  • Running Total Grouping Formula

    I have a running total condition that I need to summarize the field CAWP.BAC. I would typicaly evaluate this total for change of group 4 and reset on change of group 3. I need to condition the evaluation for ".900" in {CAWP.WP} but i also need to evaluate for change of group 4. Does any one have any examples of a formula for evaluation "on change of group"?

    Hi John,
        For this you can try using manual running total formula's.
    1) Create a @reset formula as below and place it in group header 3.
        Formula :
        Whileprintingrecords;
        Numbervar i:=0;
    2) Create an @evaluation formula and place it in detail section.
       Formula:
       whileprintingrecords;
       numbervar i;
       if {CAWP.WP} = ".900" then
          i:= i+ {CAWP.BAC}
    3) Create a @display formula and place it in group footer 4.
        Formula:
        whileprintingrecords;
        numbervar i;
    Hope this will help!!
    Regards,
    Vinay

  • Running total for item availbe qty. from On Hand - SO + PO by promise date

    I stuck with Balance(running total).
    How to link item number with SO and PO?  
    Need daily item qty. available qty from "On Hand" Qty. + PO - SO by promise date and sort by ascending?
    Item#    Order Date  SO/PO   PromiseDate  Qty   Bal.
    AE01    08/01/08     OnHand                       20     20
                08/02/08     SO#1877   08/05/08       -3    17
                08/04/08     SO#2044   08/08/08       -6    11
                07/22/08     PO#632     08/10/08      10   21
    Thanks.

    create a group by promise date
    2nd group by po#
    put the fields either in the group or in the details
    PO#, PO promise date, qty and SO#, SO promise date, qty then availability qty
    manual running totals
    create 3 formulas
    1 reset
    WHILEPRINTINGRECORDS;
    NUMBERVAR ITEMLOC := 0;
    place in the group header on what you want the total to reset by (po#)
    1 calc
    WHILEPRINTINGRECORDS;
    NUMBERVAR ITEMLOC := ITEMLOC +(qty};
    this gets placed where the calculate will take place (next to qty)
    1 display
    WHILEPRINTINGRECORDS;
    NUMBERVAR ITEMLOC;
    ITEMLOC
    this gets placed in the group footer.
    for each field that gets calculated by a group create 3 formulas for each
    they need to have the same variable name to reference each other.
    if you need to create a 2nd set to calc something else give that a new variable name.

  • Formula Help - Running Total vs ???

    Post Author: schilders
    CA Forum: Formula
    Good Morning All,
    I'm creating a report that contains a field called CDM Item.  This field indicates whether a particular order set was used for a given record.  Valid entries for this field are numeric 6 through 9.  I would like to create a formula that tells me the number of records that have a cdm item = 6, another formula that tells me the number of records that have a cdm item = 7 etc.  I need to summarize these formulas into pre-defined groups. 
    I was thinking a running total or a manual running total would be useful here.  However, I wanted to get some input from other formula gurus here.  Thanks, in advance, for your help.

    Post Author: yangster
    CA Forum: Formula
    You don't need to create a manual running total for what you are after.simply create 4 running totals ( 1 for each item number) using a running total with the evaluate formula of cdm =  6 (changed for each number)and resetting after whatever grouping you needthe other alternative you could implement if you have mutliple grouping and wanted subtotals on differing levels is to create a formula for each case such as@case_cdm6if cdm = 6 then 1 else 0then insert sum for each formula on all the differing group levels that way you only have to worry about maintaining one formula if the criteria changes

  • Running Total on a Running Total

    Post Author: MikeA-ICE
    CA Forum: General
    I have set up a running total on a field in a subreport and it is calculating correctly. I set the running total in the Report Footer of the report, then I created a variable which passes the running value back to the main report. The variable is placed in a Group Footer on the main report and it resets on each change of the group. However, now I need the grand total of that running total to appear in the Report Footer of the main report. I created a manual running total formula and placed it it in the Report Footer of the main report. Here it is:NumberVar Sect2MatlTotal;WhilePrintingRecords;NumberVar Sect2MatlTotal := NumberVar RunningSect2MatlTotal + {@Material$Var2a}  The problem is that the value that comes out is grossly larger than it should be. It should be $112,350,582 but it comes back as $212,603,556, which is nearly double what it should be. Can anyone suggest a method that would allow me to place the running total in the Report Footer of the main report and get the correct value that is visible in the Group Footer just above it?

    Post Author: V361
    CA Forum: General
    you may need to select evaluate on group, or reset on group to get this to work.  or just use the shared variable to bring the total down.

  • 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.

  • Summary on a formula field that makes a condition on a running total

    Hi,
    How come I can't create a summary on a formula field that makes a condition on a running total ?
    My running total field is a counter that counts the number of individuals
    My formula field contains this info :
    IIF ( ( {#counter_running_total} <> 1)
        or ( {#counter_running_total} = 1
              and {status.code} = '04' )
        or ( {#counter_running_total}  = 1
              and {status.code} in \[ 208 , 996 ])
    ,0,1)
    When I right-click on the formula field to insert a summary, it does not allow me.
    Do you have any idea I can show the information in a better way ?
    Thanks
    Steph
    Edited by: Stephanie Charest on Aug 4, 2008 8:00 PM

    Thank you very mutch for your reply, I tried it and it works.
    The thing is, I would like to reset the counter on change of group, and put the manual running total in the group footer.
    Is there a formula I could use to reset the counter ?
    When I write in the group header :
    whileprintingrecords;
    numbervar i=0;
    it does not reset the i to zero, instead, it writes "false" and continues to increment in the footer.
    do you have an idea ?
    Thank's
    Steph

Maybe you are looking for

  • Inserting rows in a table

    Dear experts, Greetings. I  have a small VC application in wich the data entered in the input fields should be displayed on a table upon clicking a button. But when I enter the next set of data, the first row is being replaced. I tried (Assign & Inse

  • Why does my mic not work?

    I need to yell for it to work. Is there a volume for the mic ?

  • Data migration from 4.7 system to ECC 6.0

    Hi All, I am a Solution Architect. Currently working on a typical pursuit requirement. the requirement is as below: One of our customer is currently on SAP 4.7 system.  Their current system is shared by 2 companies & the companies got demerged now. H

  • Random FLV from an SMIL Playlist

    I have been trying to find a way to randomly select an flv file to play in a 400x100 signature I have for some of my forums. There is no user control on this swf besides onRollOver to start the flv and onRollOut to pause it. What I want to achieve is

  • Losing form elements and referer when opening in a javascript window

    I am submitting from a.cfm to b.cfm. b.cfm opens in a Javascript window. In b.cfm, the form elements from a.cfm are lost and cgi.referer returns nothing. When I don't open b.cfm in a Javascript window, everything is ok. What is this happening?