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

Similar Messages

  • 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 and Formulas with Cross Tabs

    Hi,
    I'm using Crystal Reports 2008 and am having two issues using Cross Tabs.
    The first is that I want to have two crosstabs. They both will have a common Y axis (Oppourtunity.Sales Rep), and on the Y Axis I want one to show all (Opportunity.Create Date) where (Opportunity.Staus = Won) and the other where (Opportunity.Staus = In Process), but I can't figure out how to contruct the formula to return this result.
    The other issue, is that in addition to summarizing based on Sum (Opportunity.Expected Revenue), I would also like to create a running total to show the cumulative (Expected Revenue) Week over Week.
    Any direction would be fantastic.
    Thank you,
    Michael

    Please go through the SAP Notes listed here which would help you how to create mannual running totals in crosstab
    [https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_ossnotes&query=runningtotalin+crosstab&adv=true&note_number=&component=&sdn_updated_on_comparator=GE&sdn_updated_on=&sortby=cm_rnd_rankvalue]
    Regards,
    Raghavendra

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

  • Running total condition formula

    Hi all!! I am trying to have a running total based on some conditions but my formula is not working. Mabey someone has some idea how to approach this problem
    {CAWP.C7}="committed.aic" or
    {CAWP.C7}="committed.anic" and {TPHASE.CECODE}<>"bonds" or
    {CAWP.C7}="committed.anic" and {TPHASE.CECODE}<>"conserv" or
    {CAWP.C7}="committed.anic" and {TPHASE.CECODE}<>"const contingency" or
    {CAWP.C7}="committed.close" or
    {CAWP.C7}="committed.sunk"
    I am looking to sum only the records that test for all "committed.anic" and not include the "bonds","conserv","const contingency" etc..... from another table
    does any one have any ideas of how to approach this?????

    Try this using braces for each condition
    {CAWP.C7}="committed.aic" or
    ({CAWP.C7}="committed.anic" and {TPHASE.CECODE}"bonds") or
    ({CAWP.C7}="committed.anic" and {TPHASE.CECODE}"conserv") or
    ({CAWP.C7}="committed.anic" and {TPHASE.CECODE}"const contingency" )or
    {CAWP.C7}="committed.close" or
    {CAWP.C7}="committed.sunk"
    Regards,
    Raghavendra

  • Cumulative Balance Running Total

    Hello community,
    i am doing a business partner Account balance report, i have already successfully fetch my data in to crystal reports as well as the running total for the cumulative balance, my problem is i have a duplicated rows in debit side, now how will i say to crystal reports (in Formula expression) that the 1st line if duplicated will the only one to be evaluated. for more detail please see image below
    http://i264.photobucket.com/albums/ii184/abing430/CRDuplicatedRows.png
    http://i264.photobucket.com/albums/ii184/abing430/CRDuplicatedRows-1.png
    please help.
    best regards,
    Fidel

    hello sharonamt,
    thanks for the response.
    //Head
    Shared NumberVar OB := {Command.Open Balance}
    //Line
    shared numbervar OB;
    OB := OB + {BP_AccountBalance;1.Credit} - {BP_AccountBalance;1.Debit}
    //Footer
    Shared numbervar OB
    i have this ff. formula the header is put in the page header, the line is put ing Group Footer section and the footer is put in report footer section. my group is grouped by Ref field w/c is unique in this report.
    the duplicated rows is eliminated since i put my line formula in the group footer. but using the ff. formula's the report is ok, the results is fine on the first page only, because in the second page it will get the OB balance which is in the page header of the report., i dont needt to reset my running total.
    thanks.
    please help
    best regards.
    EDIT:
    i have manage to figure out my problem... i just use this formula and it works.
    whileprintingrecords;
    if pagenumber = 1 then Shared NumberVar OB := {OpeningBalance.Open Balance}
    else
    0
    since im having problem with reseting of the openingbalance, i had trap the page numvber and never reset the running total. this formula works for me as of now.
    Fidel
    Edited by: Avelino Fidel on Jan 24, 2011 2:46 PM

  • 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 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 - How to summarize a formula field?

    I'm sorry if this comes over as stupid but I have got myself quite messed up and am not 100% au fait with Crystal Reporting.
    The aim of my report is to calculate the costs of selected tests and to calculate a grand total of all tests at the end.
    I have created a group of  jobtests.TestTypeName
    Details
    1. testTypeName - to show Test Name that is being calcutaed - Database field
    2. Count ({jobTests.testTypeName}, {jobTests.testTypeName}) - to show number of tests of that type - this is a formula field
    3. Analysis1 - to show the cost of that test type - Database field
    4. {@CountTests/TestType} * {jobTests.AnalysisN1} - to show the number of tests per test type mulitplied by the cost of that test type - this is a formula field
    Report footer
    Count ({jobTests.testTypeName}) - to count the total number of tests
    MY PROBLEM - I need to see the sum of 4, this would be my grand total
    Trying to run the Running Total I can't get it to Summarize the field 4 because it is a formula field.
    What can I do?
    Thanks.

    You can't do a SUM on a formula that uses another aggregate function.  However, for both 4 and your grand total, you just need to SUM() (with ",{jobTests.testTypeName}" for the #4 calc), as the database field will be the cost for each test in each record.
    HTH,
    Carl

  • Error when using running total variable in formula

    This is probably an easy syntax problem, but I'm fairly new to Crystal reporting.  I created a running total variable (count) called InquiryTypeSubtotal that simply counts the number of records.  I have one grouping level, and in the group footer I'd like to print a line showing the total count for that group that looks like
    Total inquiries for Assistive Technology: 3
    To accomplish this I'm using a formula field with the following syntax:
    "Total inquiries for " + {CnAttrCat_1.CnAttrCat_1_Description} + ": " + ToText(@InquiryTypeSubtotal)
    When I try to check the formula, I get the error message "The ) is missing."  What am I doing wrong?
    Thanks,
    Alec

    I put in the curly brackets so my formula now reads
    "Total inquiries for " + {CnAttrCat_1.CnAttrCat_1_Description} + ": " + ToText({@InquiryTypeSubtotal})
    Now when I check the formula I get the error message "This field name is not known."
    Alec

  • 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 across 2 grouping

    Hi All
    I have created a crystal report and i have 2 remaining issues that i just cant get around.
    the report is basically about all the net stock position.
    the report is based on a query..that links sales order to all target documents that originate from the sales orders, i.e...deliveries, invoices, returns, credit notes.
    then i also brought in all the open purchase orders and the instock from the oitw
    i then sumed up the lines so the sales order > Delivery > invoice > credit note > returns all shows in one line..and if there is a different unit of measure it will be another line for that sales order
    the report is grouped:
                                  per warehouse
                                  per item
                                  per Sales Order Num
                                  per Item Unit of Measure
                                  per Line Num
    1st issue:
    in the selection criteria if the sales order is closed but if one of the delivery notes is open it should bring in the "whole set" not just the the open deliverys linked to the sales order.
    this is because the delivered quantities adds up to the net position of the stock.
    2nd issue:
    I have to work out a net postion
    formula: net stock = Oitw.instock + PO - remaining qty on sales order
    I got the sales order as a negative
    i used a running total formula, but it does not work if the sales order has more then one unit of measure.
    whileprintingrecords;
    If onfirstrecord or previous({Command.SO No.})<>{Command.SO No.} then
    numbervar remain_bal:= remain_bal + {@QTY}
    i tried to add another if statement..but does not work
    whileprintingrecords;
    If onfirstrecord or previous({Command.SO No.})<>{Command.SO No.} then
    If onfirstrecord or previous({Command.SO Uom)<>{Command.SO Uom.}  then
    numbervar remain_bal:= remain_bal + {@QTY}
    any help will be gladly welcomed..
    thank you all
    Jerusha

    Hi Dave
    Thank you very much for your feedback.
    I have been using the base UoM, ie InvQty field.
    my issues comes where i am grouping I am 1st grouping by sales order num, then by uom as the customer wants to see that as separate entries
    Example:
    SO Num     Uom     Qty     InvQty
    1               Bags     50         200
    1               Bulk     100        100
    This is the forumula for the running total:
    If onfirstrecord or previous ({Command.SO No.}) <> ({Command.SO No.}) then
    if ({Command.Doc Type}) = 'SO' then
        SO := SO + {@QTY}
    However when i "print" my total and add it to the footer.. it will show 200 instead of 300.
    Thanks
    Jerusha

  • Running total in group header doesn't display when it's at page bottom

    Post Author: Charles Denight
    CA Forum: Formula
    Hi, Using v.9 of Crystal Reports I've created some running totals using a cross-tab workaround to get the running totals into the group headers, but when the group header falls at the bottom of the page then the running total doesn't show up.Would appreciate knowing why and how to fix this.

    Replacing an item that is malfunctioning because of a manufacturing error is the bare minimum I would expect from customer service for any electronics item.
    The thing Apple does extremely well is their flat fee policy for repairs on their computers.
    I managed to break my MacBook pretty seriously (logic board needed to be replaced) and I'm sure it cost them more to repair the unit than the $328 they charged me.
    I probably would have been angry if it was something minor, but I'm guessing that most repairs to screens/motherboards/etc cost more than their flat fees.

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

  • 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

Maybe you are looking for

  • NiDAQ 7.0 Still doesn't recognide ND_PATTERN_GENERATION_LOOP_ENABLE?!?

    I can't get it to recognize this, even after uninstalling the 6.9.3 version and reinstalling 7.0. This is for the PCI6534 card. Anyone have any info?

  • Problem with start up Adobe Photoshop Elements 8

    Tried to start up my Adobe Photoshop Elements 8 on my MacBook Pro running on Maverick 10.9.5  it would not startup and this message popped up! Can anyone help? I need to use my scanner for scanning and Photoshop Elements to merge the pix together (us

  • Reduce Calc Time

    Afternoon everyone, We load data into our cube monthly, and when running the calc on the database it can take between 2/3 days to complete. I appreciate that calc time can be determined by a wide variety of factors (number of dense/spare dims/members

  • Oracle user id

    hii how will i get the user id into my forms ?? i mean i have a field 'created by' which stores the id of the user where and how do i get the user id into my text field ?? plzz help mandar

  • Hpzsetup.exe windows vista 32 bit

    Hello i keep getting this prompt hpzsetup.exe over and over. i have tried uninstalling and reinstalling and i just cannot get rid of it. can anyone help? i have an HP Photosmart D7160 and an Officejet J3680. i am very frustrated! thanks Curtis