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?

Similar Messages

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

  • SSRS Running Totals Custom Code

    I have a report in which I need to total a column with an expression and created simple code to have a running total.  When I run the report through report builder, the total only reflects the current page (it is 6 pages long) but if I export the report
    out to Excel, the total is correct.
    Below is the code:
    Public running_roy as Double = 0
    Public Function roy_tot(ByVal cust_type, ByVal roy, ByVal ret_value) as Double
    Dim temp_var as Double
    if cust_type = 0 then
    running_roy = running_roy + roy
    if ret_value = 0 then
    temp_var = roy
    else
    temp_var = running_roy
    end if
    ELSE
    temp_var = 0
    end if
    return temp_var
    End Function
    If I change the Public variable to "Public Shared" the totals change as I flip back and forth between the pages in report builder.
    Any suggestions?

    Hello alan2624,
    Thanks for your clarification.
    In the report, the custom code will be compiled as a class before it is used. Every time the page is loaded, the class on the page will be initialized. The un-shared (non-static) instance will be reset. Therefore, you will see the value is reset back to
    zero if the public variable is not announced as "Shared". If you announced it as shared, then the variable is on the class level. It will not be changed by instance initializing. In addition, any operations on the variable will be recorded. This is not the
    bug, but it is by design of the VB.net code.
    If you export the report to the Excel, I think it will only generate a single page, and the total value is only the last one. It should be correct. If it is used in the pages in browser, I suggest you need design your code carefully for VB.net design.
    If you have any questions about this issue, please let me know.
    Regards,
    Edward
    Edward Zhu
    TechNet Community Support

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

  • How to create a loop to run total of records for before and after unconstant date

    Post Author: Ann2
    CA Forum: Formula
    Here is the data sample:
    ID period code date
    1  00  I    01/01/1999
    1 00   Z   01/02/1999
    1 00  G   12/05/1999
    1 00  M   01/01/2000
    There are many students with many periods and many codes. I need to save a date when code = 'G' and count separateley records per student/period 2 times - before and equal that date and after that date, so in the end for period 00 I will have 2 values: 3 (before) and 1(after).
    There are periods from 00 to 08. I am counting students abscencies before and after warning letter was sent (code G).
    The result data should look : 00 01 02 03 04 05 06  07  08              00 01 02 03 04 05 06  07  08     Total
                                                3  0   0   0   0   0   0   0   0                 1 0    0   0   0   0   0   0   0        4
    Please help me.
    Thank you.
    Ann2

    Post Author: Ann2
    CA Forum: Formula
    Thank you for your answer, but I do care about the date the 'G' happened, because I need to reset count.
    The logic behind is this:if a student absent for more than 8 times per period - the letter will be sent out to the parents , that will be code 'G' with period '-1' (it may happen that there will never be code 'G' , but I need to track all absencies). Once the letter is sent, the count starts over (the count starts over the next day after code 'G'). The absencies which happened before or the date the letter sent should count toward 'previous'  abscenices, all other - absenices after the letter.
    So basically I need total per period and total per period before or the day with code 'G'.  Running total with reset with formula code = 'G' does not work.
    I created a formula field which has global date (when code 'G' happenned) and it says if globaldate >= periodDate then date (1900,01,01) else (2100,01,01) and that formula is ok, but I can not use it in running total or can not create group on it and insert total.
    Please help me with this. Thank you.
    Ann2

  • 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

  • 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

  • Help with a resetting running total

    Hi, I need help with a query that will have a running total that resets at certain points
    Version
    BANNER                                                                        
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production    
    PL/SQL Release 11.2.0.3.0 - Production                                          
    CORE  11.2.0.3.0  Production                                                        
    TNS for Linux: Version 11.2.0.3.0 - Production                                  
    NLSRTL Version 11.2.0.3.0 - Production sample data
    create table t ( stat varchar2(3)
                   , beg_dt date
                   , end_dt date
                   , dur    number);
    Insert into t  values ('ACT',to_date('01-JUL-2012','DD-MON-YYYY'),to_date('31-JUL-2012','DD-MON-YYYY'),31);
    Insert into t  values ('ACT',to_date('01-AUG-2012','DD-MON-YYYY'),to_date('31-AUG-2012','DD-MON-YYYY'),31);
    Insert into t  values ('ACT',to_date('01-SEP-2012','DD-MON-YYYY'),to_date('30-SEP-2012','DD-MON-YYYY'),30);
    Insert into t  values ('LOA',to_date('01-OCT-2012','DD-MON-YYYY'),to_date('25-OCT-2012','DD-MON-YYYY'),25);
    Insert into t  values ('LOA',to_date('26-OCT-2012','DD-MON-YYYY'),to_date('31-OCT-2012','DD-MON-YYYY'),6);
    Insert into t  values ('LOA',to_date('01-NOV-2012','DD-MON-YYYY'),to_date('04-NOV-2012','DD-MON-YYYY'),4);
    Insert into t  values ('ACT',to_date('05-NOV-2012','DD-MON-YYYY'),to_date('10-NOV-2012','DD-MON-YYYY'),6);
    Insert into t  values ('LOA',to_date('11-NOV-2012','DD-MON-YYYY'),to_date('30-NOV-2012','DD-MON-YYYY'),20);
    Insert into t  values ('LOA',to_date('01-DEC-2012','DD-MON-YYYY'),to_date('15-DEC-2012','DD-MON-YYYY'),15);
    Insert into t  values ('ACT',to_date('16-DEC-2012','DD-MON-YYYY'),to_date('31-DEC-2012','DD-MON-YYYY'),16);
    Insert into t  values ('LOA',to_date('01-JAN-2013','DD-MON-YYYY'),to_date('31-JAN-2013','DD-MON-YYYY'),31);
    Insert into t  values ('LOA',to_date('01-FEB-2013','DD-MON-YYYY'),to_date('05-FEB-2013','DD-MON-YYYY'),5);
    Insert into t  values ('LOA',to_date('06-FEB-2013','DD-MON-YYYY'),to_date('15-FEB-2013','DD-MON-YYYY'),10);
    Insert into t  values ('LOA',to_date('16-FEB-2013','DD-MON-YYYY'),to_date('25-FEB-2013','DD-MON-YYYY'),10);
    Insert into t  values ('LOA',to_date('26-FEB-2013','DD-MON-YYYY'),to_date('28-FEB-2013','DD-MON-YYYY'),3);
    Insert into t  values ('LOA',to_date('01-MAR-2013','DD-MON-YYYY'),to_date('10-MAR-2013','DD-MON-YYYY'),10);
    Insert into t  values ('ACT',to_date('11-MAR-2013','DD-MON-YYYY'),to_date('31-MAR-2013','DD-MON-YYYY'),21);
    Insert into t  values ('ACT',to_date('01-APR-2013','DD-MON-YYYY'),to_date('30-APR-2013','DD-MON-YYYY'),30);
    Insert into t  values ('LOA',to_date('01-MAY-2013','DD-MON-YYYY'),to_date('25-MAY-2013','DD-MON-YYYY'),25);
    Insert into t  values ('LOA',to_date('26-MAY-2013','DD-MON-YYYY'),to_date('31-MAY-2013','DD-MON-YYYY'),6);
    Insert into t  values ('LOA',to_date('01-JUN-2013','DD-MON-YYYY'),to_date('04-JUN-2013','DD-MON-YYYY'),4);
    Insert into t  values ('ACT',to_date('05-JUN-2013','DD-MON-YYYY'),to_date('30-JUN-2013','DD-MON-YYYY'),26);This is close.
    select stat
        , beg_dt
        , end_dt                            
        , dur
        , sum( case stat when 'LOA' then dur else 0 end ) over ( partition by stat order by beg_dt) tot1
    from t
    order by beg_dt
    STAT BEG_DT      END_DT      DUR TOT1
    ACT  01-JUL-2012 31-JUL-2012  31    0
    ACT  01-AUG-2012 31-AUG-2012  31    0
    ACT  01-SEP-2012 30-SEP-2012  30    0
    LOA  01-OCT-2012 25-OCT-2012  25   25
    LOA  26-OCT-2012 31-OCT-2012   6   31
    LOA  01-NOV-2012 04-NOV-2012   4   35
    ACT  05-NOV-2012 10-NOV-2012   6    0
    LOA  11-NOV-2012 30-NOV-2012  20   55
    LOA  01-DEC-2012 15-DEC-2012  15   70
    ACT  16-DEC-2012 31-DEC-2012  16    0
    LOA  01-JAN-2013 31-JAN-2013  31  101
    LOA  01-FEB-2013 05-FEB-2013   5  106
    LOA  06-FEB-2013 15-FEB-2013  10  116
    LOA  16-FEB-2013 25-FEB-2013  10  126
    LOA  26-FEB-2013 28-FEB-2013   3  129
    LOA  01-MAR-2013 10-MAR-2013  10  139
    ACT  11-MAR-2013 31-MAR-2013  21    0
    ACT  01-APR-2013 30-APR-2013  30    0
    LOA  01-MAY-2013 25-MAY-2013  25  164
    LOA  26-MAY-2013 31-MAY-2013   6  170
    LOA  01-JUN-2013 04-JUN-2013   4  174
    ACT  05-JUN-2013 30-JUN-2013  26    0 I need a running total of LOA stat that will reset itself with each break of ACT so that I get :
    STAT BEG_DT      END_DT      DUR TOT1
    ACT  01-JUL-2012 31-JUL-2012  31    0
    ACT  01-AUG-2012 31-AUG-2012  31    0
    ACT  01-SEP-2012 30-SEP-2012  30    0
    LOA  01-OCT-2012 25-OCT-2012  25   25
    LOA  26-OCT-2012 31-OCT-2012   6   31
    LOA  01-NOV-2012 04-NOV-2012   4   35
    ACT  05-NOV-2012 10-NOV-2012   6    0
    LOA  11-NOV-2012 30-NOV-2012  20   20
    LOA  01-DEC-2012 15-DEC-2012  15   35
    ACT  16-DEC-2012 31-DEC-2012  16    0
    LOA  01-JAN-2013 31-JAN-2013  31   31
    LOA  01-FEB-2013 05-FEB-2013   5   36
    LOA  06-FEB-2013 15-FEB-2013  10   46
    LOA  16-FEB-2013 25-FEB-2013  10   56
    LOA  26-FEB-2013 28-FEB-2013   3   59
    LOA  01-MAR-2013 10-MAR-2013  10   69
    ACT  11-MAR-2013 31-MAR-2013  21    0
    ACT  01-APR-2013 30-APR-2013  30    0
    LOA  01-MAY-2013 25-MAY-2013  25   25
    LOA  26-MAY-2013 31-MAY-2013   6   31
    LOA  01-JUN-2013 04-JUN-2013   4   35
    ACT  05-JUN-2013 30-JUN-2013  26    0 Any help would be appreciated, thanks.

    Hi,
    So, you want a separate total whenever there's an 'ACT'. That's what PARTITION BY is for. You need to add the number of ACTs already encountered (which I called act_cnt) to the PARTITION BY clause that gets you the SUM.
    We can get act_cnt using the analytic functions like COUNT or SUM, but, since one analytic function can't depend on another computed inthe same query, we need to use a sub-query to compute act_cnt.
    Here's one way:
    WITH     got_act_cnt     AS
         SELECT     stat, beg_dt, end_dt, dur
         ,     COUNT (CASE WHEN stat = 'ACT' THEN 1 END)
                  OVER (ORDER BY  beg_dt)   AS act_cnt
         FROM    t
    SELECT       stat, beg_dt, end_dt, dur
    ,       SUM (CASE stat WHEN 'LOA' THEN dur ELSE 0 END)
             OVER ( PARTITION BY  stat
                     ,                act_cnt     -- ***** NEW *****
                 ORDER BY      beg_dt
               )       AS totl
    FROM      got_act_cnt
    ORDER BY  beg_dt
    ;Are 'ACT' and 'LOA' the only possible values for stat? If so, the query above can probably be simplified.

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

  • How do I put a running total in a Reports 6i Report?

    I need to write a report which shows a running total at the foot of each page. The report is a series of (potentially) multi-page sections each formatted like this:
    Page 1
    ======
    Tom £100
    Dick £150
    Harry £100
    Sub Total £350
    Page 2
    ======
    Peter £200
    Paul £50
    Mary £100
    Total £700
    Lines are of variable height, so I can't predict how many there'll be on a page.
    The help system just tells me to "use a summary field". Yeah, right. Can anybody give me some more detailed instructions?
    -- Chris Hunt

    Thanks for that.
    I didn't really express the problem as well as I might have done, as the Sub-Total needs to be the sum of all the items on the current page and on all preceeding pages. resetting on page just gives you the total for that page.
    I did find a way to do it. First you set up a summary field in the same group as the data lines, summing the amount and resetting on the parent group. This gives you a running total for each row:
    Page 1
    ======
    Tom £100 £100
    Dick £150 £250
    Harry £100 £350
    Page 2
    ======
    Peter £200 £550
    Paul £50 £600
    Mary £100 £700
    You don't actually output this summary field in the prinout (except when debugging :-) ). Now create a summary field at the foot of the page, or in the margin. Set its value to the Max() of the running total summary, resetting on page. That gives you the amount required, assuming all individual amounts are positive.
    If it's possible to have negative amounts, I expect that using Last() instead of Max() for the page summary would do the trick.

  • Getting running total formula result at the beginning of the report

    Hello All,
    I am having an inquiry that if I can get a grand total in the report footer to the report header.
    The grand total is not a direct sum.  I am using three formulas
    the first formula:
    @reset Group Header
    whileprintingrecords;
    numbervar sumpct4;
    if not inrepeatedgroupheader then
    sumpct4 := 0;
    the second formula: Details section
    whileprintingrecords;
    numbervar sumpct4 := sumpct4 + {@Total_Market};   // {@Total_Market}; =  Amount+ Interest
    numbervar grtotal4 := grtotal4 + {@Total_Market};
    Group Footer
    whileprintingrecords;
    numbervar sumpct4;
    Report Footer
    whileprintingrecords;
    numbervar grtotal4;
    All that I need is to show the total which is in the report footer at the top of the page where I am having a summary.
    So, can you please help me.
    Thanks
    Edited by: maas maas on Sep 8, 2010 12:48 PM

    Hello my friend,
    I want this to be controlled in crystal.
    Is there is a way to get the grand total by using multiple formulas or any other way?
    Here is the structure of my report:
    Group Header 1: CCY
    Group Header 2:Type
    @reset Group Header
    whileprintingrecords;
    numbervar sumpct4;
    if not inrepeatedgroupheader then
    sumpct4 := 0;
    Group Header 3A: Deal No
    Group Header 3B: Deal No (subreport to get the {@amount} for each deal)
    I will pass the end_date from the main report to subreport and I will get the sum(amount) for each deal between date (1-1-2008) to end_date. The sum will be as a shared variable to the {@amount} formual in the main report.
    Details:
    Deal No, {@amount}, {@Price}, {@market}, {@Total_Market}
    {@Price}: if {table.price} = 0 then
    100
    else {table.price}
    {@market}: if Type <> "DEP" then
    ({@amount}*{@Price})/100
    else
    {@amount}
    {@Total_Market}:{@market}+ {@Price}
    Running formula to get Total_market: Details section
    whileprintingrecords;
    numbervar sumpct4 := sumpct4 + {@Total_Market};
    numbervar grtotal4 := grtotal4 + {@Total_Market};
    Group Footer 3B: Deal No
    Group Footer 3A: Deal No
    Group Footer 2:Type
    In this group I am placing a running total formula:
    whileprintingrecords;
    numbervar sumpct4;
    Group Footer 1: CCY
    Report Footer:
    @grand_Total
    whileprintingrecords;
    numbervar grtotal4;
    Now, i want this @grand_total formula result to be shown in Group Header 1: CCY.
    I tried to insert a subreport at the beginning which it is a copy of the main report, but I did not get the coorec t result because I am getting the {@amount} from a subreport and in crystal I can't insert a subreport in an existing subreport.

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

  • 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

  • Running Total Fields - using formula, but can't get what i want?

    Hi All,
    I have already searched some forum, but still can't figure out what going wrong. Can anyone help me?, please
    I create a view from access named u201CStatementReportu201D and have the following field.
    <InvNo>
    <CustNameC>
    <JobItemNo>
    <InvDate>
    <JobTypeId>
    <JobPrice>
    I create three parameter as CustName, StartDate, EndDate, then I create a Group to group <InvNo> as the report detail and a Running Total Fields for calculate the total of <JobPrice>.
    So far the report is fine. Showing the grouped <InvNo> and the total amount of <JobPrice>
    Then, I want to calculate the <JobPrice> by the condition of <JobTypeId>.
    First, I create a new Running Total Fields
    Field to summarize = StatemetnReport.JobPrice
    Type of summary = sum
    Second, I create a formula as following
    whileprintingrecords;
    global numbervar type1_sum :=0 ;
    if {statementRe.JobTypeId} = 1 then
        type1_sum := type1_sum + {statementRe.JobPrice};
    type1_sum;
    After completed the formula, and i press Ok button.
    A dialog appear "Warning: Reset/evaluate condition formula contains variables. Do you want to keep it?"
    No matter i click Yes or No, I still can't get anything display on the field.
    Edited by: manho88 on Mar 9, 2010 9:42 AM

    Hi,
    Instead of running total use can try this formula.
    Place this formula in the details section.
    whileprintingrecords;
    numbervar jpsum;
    if =111 then
    jpsum:=jpsum +
    else 0;
    You can modify this formula as per your requirement.
    Hope this helps.

Maybe you are looking for

  • Safari 5.1.7 "Invalid URL" & "certificate not valid"-Google won't even work! HELP

    I have the newest version of Safari and as far as I know everything else on my computer is up-to-date. I checked for a software update and it claims everything is up to date. This has been happening for a little while and started with the invalid sit

  • Using external libraries in Web Dynpro DCs

    Hi, I've followed the example in the following blog for using external libraries in my Web Dynpro (WD) DCs: /people/valery.silaev/blog/2005/09/14/a-bit-of-impractical-scripting-for-web-dynpro and some other messages in the forums. However, it isn't w

  • JMS Content Conversion

    Hi all, is possible to do content conversion in JMS Adapter of a file whit the following structure? -Root --Header ---A ---B ---C --Content ---Record_A D E F ---Record_B G H Record_C I J And if it's possible....how to do it? Thanks all Mane

  • Crawler not indexing the documents from repository

    Hi All, I've installed TREX 6.1.09 with EP6.(version=6.0.9.0.0 and KnowledgeManagementCollaboration 6.0.9.0.0 (NW04 SPS09) on my Windows 2003 platform. NameServer port is configured in J2EE visual Administrator and also all lights are green in TREX M

  • Multi-language support for change password page in OAM

    How do we setup multiple language change password from lost password management in OAM. Thanks. Vinay