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

Similar Messages

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

  • Running Total Issue:  How to calculate counts excluding suppressed records

    Post Author: benny
    CA Forum: Formula
    Hello All:
    I have a current report that gives the total counts of work requests.   However, in my section expert, there are some records in the detail that are suppressed (if there isn't any backlog). The current running totals are counting all the records including the suppressed records. I think I need three formulas:1. Calculate the counts2. Calculate the counts excluding suppressed records3. Reseting the counts by group
    May I ask if someone can give me an example of what I should do?
    Thanks so much!
    Benny

    Post Author: benny
    CA Forum: Formula
    Bettername,
    Actually, I should have been more specific.  This report is actually a PM backlog report.  It displays all the work requests (PM) issued including the backlogged. There are 9 columns (including one called Backlog) for the different counts of the pm's based from the status codes (Issued, Material on Order, Completed, Cancelled, etc) of the work requests. The detail records of worke requests are grouped by shop and PM end date.  The running totals are calculated at the pm date group level (group footer#2). Then based from those at the shop group level (group footer#1) there is a grand total of counts of the running totals. The detail records and pm end date group header (group header #2) are suppressed.
    Now the foremen would like the report to just display all the backlogged PMs. Using the section expert, I suppressed all the PM issued that have no back log ({@ backlog = 0}) and just display the back logged pm's.  This is where I run into the running total issue.
    This is very involved report and I will use the column PM Issued as an example.  I can still use the same logic as you suggested?
    1. declaration formula:
    whileprintingrecords;numbervar pmissued := 0;
    2. Suppression formula that uses the variable:
    whileprintingrecords;
    numbervar pmissued;
    if ({@ backlog = 0}) then pmissued:= pmissed else pmissued:=pmissuedr+1
    3. Display formula:whileprintingrecords;
    numbervar pmissued;
    If this is the right track, then I can use the same example for the other columns. 
    Thanks so much.
    Benny

  • 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

  • Running Total Issue or Possibly Formula Issue in Crystal Reports 9

    Post Author: Jeffs23
    CA Forum: Formula
    My issue involves two formula's - @TotalTime and @Converted Time and a Running Total (RTotal0).
    @TotalTime{Data.ApptTime}/60@Converted Timenumbervar x := {#RTotal0};totext(truncate(x),0,"")" Hrs "totext(remainder(x,truncate(x))*60,0,"") + " Mins"Running Total (RTotal0)
    Field to Summarize - @TotalTime
    Type of Summary - sum
    Under Evaluate Section:
    "Use a Formula":
    onfirstrecord or
    {Data.ResourceStart} <> previous({Data.ResourceStart}) or
    {Data.Resource} <> previous({Data.Resource})
    ) and
    minimum({Data.ApptKind},{Data.ResourceStart}) = 1 AND
    maximum({Data.Column},{Data.ResourceStart}) >= '1'
    Reset on change of field {Data.Resource}
    A little background:My report deals with a Doctors schedule. In the doctors schedule, a appointment is booked and is by default placed into Column 1. It always defaults to Column 1. If the provider elects to double book their time and schedule another patient at the exact same time, the second appointment hits column 2. It expands in essence. It is possible to have up to 4 appointments in one time slot. This is why we wait forever at the Doctors office - appointments get overbooked because patients cancel or no show frequently and the provider would rather have the patients wait then risk no appointment at all. My Client wants the "TOTAL TIME" a provider was "scheduled" to see patients, not the time they actually saw the patients. So if the Provider was scheduled to see patients from 8 am to noon and had patients doublebooked for every time slot, I only want to report the overall time he saw patients regardless of the doublebooking, triplebooking or quadruplebooking. So the total time for my example should be 4 hours not 8 hours. The good news is this is painfully close to being correct! What is currently happening, is if the schedule contains more than 1 facility the time calculates wrong.  I think my issue may be in the running Total but not 100% sure. I need it to calculate time on each facility - {Data.Facility}.

    Post Author: Jeffs23
    CA Forum: Formula
    I had some minor issues with my formulas and Running Total so I modified them alittle:
    @TotalTime
    If {Data.ApptTime} = 0 then    0else    {Data.ApptTime}
    @Converted Time
    If {#RTotal0} = 0 then    "--"else    ToText(Truncate({#RTotal0}/60),0,"") + " Hour(s), " + ToText(Remainder({#RTotal0},60),0,"") + " Min(s)"
    My running total stayed the same.......
    Field to Summarize - @TotalTime Type of Summary - sum Under Evaluate Section: "Use a Formula":(onfirstrecord or{Data.ResourceStart} <> previous({Data.ResourceStart}) or{Data.Resource} <> previous({Data.Resource}) ) andminimum({Data.ApptKind},{Data.ResourceStart}) = 1 AND maximum({Data.Column},{Data.ResourceStart}) >= '1' Reset on change of field {Data.Resource}
    Some fake sample data:
    Resource = Francis, William MD
    Facility 1: River Oaks Main Clinic
    Facility 2: Western Medical Hospital
    Date of Service = 10/25/2007
    From 7:15 am to 11:45 am, Patients were treated at Facility 1: River Oaks Main Clinic *** (total time = 4 hours 30 min)
    From 12:15 pm to 1:00 pm, Patients were treated at Facility 2: Western Medical Hospital *** (total time = 45 min)
    From 1:00 pm to 3:15 pm, Patients were treated at Facility 1: River Oaks Main Clinic *** (total time = 2 Hours 15 min)
    The report should tell me Total time at River Oaks Main Clinic = 6 Hours 45 min and 45 min for Western Medical Hospital. What it currently is doing, is reporting the 6 Hours 45 min on the River Oaks Main Clinic and 7 Hours 30 min on the Western Medical Hospital. The time for this facility should be 45 minutes, yet its taking the full provider time and throwing it into this second facility. I am assuming its because the Running total tells it "Reset on change of field {Data.Resource}". Somehow, I need it to evaluate on both the Resource and the Facility. Any suggestions?

  • 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

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

  • DeEscalation formula on a running total

    I have a running total that is grouped by year. I need to test for each year and divide the total by a factor. I then need to string each year together. (each year gets a unique divisional factor). heres is what I have so far
    whilereadingrecords;
    if{TPHASE.DF_DATE}="2007" then
    {#ActiveProjDet}/1.035
    else false
    this is comming up with errors
    any thoughts for direction?

    By looking at the formula that you have, it seems to me you'll be using the Running Total field in another formula at the Detail level of the report. You may have issues referencing a Running Total in the first Detail section of the group, if the Running total has not been processed...
    First off, even if you change the runtime to WhilePrintingRecords, you may have a conflict or incorrect results. This is because by specifying this formula be processed in the 2nd pass at the same time that the Running Total has to be processed will not work.
    It may sound like I'm coming from left field - so let me land.... My suggestion would be to create a manual running total - which gives you all the flexibility to do what you want with the fields in any section of the report...
    I just scoured the web for manual running total examples and though I didn't find the exactly what I wanted (a good example from BusinessObjects itself), take a look at the following link. If you want to, you can search the BusinessObjects knowledgebase for
    +manual running totals+
    ..  Once you master this technique, you'll overcome the limitation the regular (wizard) running total field.
    http://vstoolsforum.com/blogs/crystal_reports/archive/2007/06/25/running-totals-in-crystal-reports-the-hard-way.aspx
    Will
    A better example of a Manual Running Total
    https://boc.sdn.sap.com/node/19837
    Edited by: Will Munji on Sep 11, 2008 12:16 AM

  • Running total of another running total ( or some other solution )

    I posted in my previous thread that I would like to be able to do rounding at the subtotal level and then have a total of these subtotals.  Here is the original thread:
    totals in a cross tab report
    So I was told that with the cross-tab report I can either do rounding at the details level or at the final total level.  However, I need to be able to do the following:
    Suppose I receive payments from different states.  In my report I would like to be able to display:
    - a total of all payments for one given state, rounded to whole dollars - this one is easy because I just create a running total for the payments and then at the end I round it to whole dollars
    - a total of all payments and all states as one number.  However, the problem I can't figure out here is that this grand total needs to be calculated as the SUM of the totals for each state where the total for each state is rounded to a whole dollar before being added to the grand total.  So the rounding should not be done on the final grand total but rather:
    1. calculate the total of payments for one state and round it to a whole dollar - let's call it StateTotal ( rounded)
    2. calculate the SUM of all StateTotal values.  So it needs to be a SUM of the already rounded state totals.
    Any help will be greatly appreciated.
    thanks

    hello all,
    if you want to use a manual running total then that is okay. you don't actually put the manual running total in the cross-tab expert though as you will get a print time error.
    you use the "Display String" formula dialogue on an existing cross-tab summary to do the manual running total in.
    have a look at the attached sample...there are 2 manual running totals in there...one that goes horizontally (across the columns) and one that goes vertically (down the rows).
    there is also a Xtab Info column that is there just to show you how the manual running total counter variables are incremented through the cross-tab. in crystal reports 2008 there are a lot of new cross-tab functions that are different from this but that is a completely different topic.
    i hope this helps,
    jamie

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

  • DISPLAY RUNNING TOTAL IN GROUP HEADER

    Post Author: sharonmtowler
    CA Forum: Formula
    I know there is a way to do this, just forgot how. i am in version 8.5.  i have a manual running total which calculates order qty for the entire sales order.i (dont like using the rt wizard-buggy)
    the knowledge base says to use a cross tab, but there hit or miss also.
    does anyone know how to show the display formula for a manual runnning total in the group header instead of group footer?

    Post Author: pandabear
    CA Forum: Formula
    Hi Sharon,
    I wanted to try this before I sent it to you, but my Crystal is down because (blah, blah, long story here....yawn....).
    I think I understand.  You want to show the "Total" for each group, in the group header instead of the group footer?
    My experience is that Crystal works from the top down (read: limiting), so I need a work around to do this.
    1 - Do the calculation in the query...sum by group, filter with a "Case" statement, etc.  If there's a reason you can't do that then
    2 - (and this is what I wanted to try first) see if you can group on the same field twice. 
    Group 1 - Test.field
    Group 2 - Test.field (same field)
    If you can,
    then just carry the total from the group footer of the previous group (same field) above you, and bring it down
    (shared var ?) to the group below.
    My 2 cents is up.
    Hope this helps,
    The Panda

  • 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

  • Count and Sum running total

    Can i sum and couunt running total in formula?.
    Please let me know.

    Hey, we can do count and sum functions in Running total.
    These functions are available in crystal reports for  summary fields.
    We can create  the running total based on the type of summary like Sum, count, max, min, distinct count, etc.
    We can do Evaluation for each record or on group or on each field  and also be done by writing a formula.
    We can  do count or sum by manual running total by writing a formula in the formula workshop.
    Based on our requirement we can use both functionalities.
    Please let me know  if you have any queries.
    Regards,
    Naveen.

Maybe you are looking for

  • Flashing bios + ME ofZ87-G45 Gaming Mainboard from 1.5 to the latest 1.9.

    I  have been reading and watching a lot of videos on the subject..including the general threads here. So my understanding has become ...  do not use  liveupdate 6 (mine can't even tell what I have installed).  M-flash is the official way to flash bio

  • Back to My Mac still not working even after updating to 10.5.1

    Updated to 10.5.1 on 2 machines. each machine is is in a different house but both on Verizon DSL using Westell Versalink modem/routers models 327W A90-327W15-06 with UPNP Enabled on both. Still nothing they work fine when in the same house on the sam

  • Airport Utility doens't see aiport express after reconfiguring

    I have my airport express connected through bridge mode to a 2Wire 2701 HG-B modem. I just bought this Airport Express and whenever I try to modify settings, Airport Utility can't see it after the restart, even though I'm still connected through wifi

  • Palm TX won't read memory card

    I bought a memory card for my Palm TX.  I'd like to transfer files from the handheld to the card.  When I go to the doc and click "Send to Card" I get a message saying there is no card.  I know the card is correctly installed, as it only goes in one

  • HELP: Checkpointing/Regression Scripts/SIMS Command in OpenSPARC T1???

    Hi, Does anyone know how to insert checkpoints/perform checkpointing in the OpenSPARC T1? I want to perform some error injection simulations and have a check point at a specific time so I can inject errors at the same time each time. Is there a way t