Simple question on summing a formula field

I am somewhat new to Crystal and have run across this need for the first time.  I have a simple report that allows for multiple quote numbers to be entered in a parameter, then groups lines by product # and then calculates in that group, the total quantity ordered for that pn.  In that group header, I then multiply the unit list for that pn by that total of qty ordered to come up with a total list for that pn.  I now simply need to Grand Total that group total.  I'm using Crystal 11.
Thank you!

Hmm, if you are using the SelectExpert to only report on the part numbers that you selected in the parameter, then a pair of simple formula would be the simplest way of doing it (although there are others!):
//formula1 - place in details ection and suppress;
whileprintingrecords;
numbervar grandtotal:=grandtotal+(UnitPrice * Quantity);
//formula2 - for the end of the report
whileprintingrecords;
numbervar grandtotal;
If the items on the report are not determined by your parameter choice (ie: still display them, even if not picked), then change formula1 to:
whileprintingrecords;
if QuoteNumber in {?-ParameterList}
then numbervar grandtotal:=grandtotal+(UnitPrice * Quantity);
Or you could just setup a grand total variable, and in your existing formula that does "multiple... ...pn by that total of qty" have a line prior to the end of it that adds "pn * qty" to the grand total variable?
Ideas to play around with at any rate...

Similar Messages

  • Simple Question: Carriage Return in description field

    Hi,
    i need to know how to insert a carriage return in my description field.
    Its a string field and I use the following code:
    rpt.DataDefinition.FormulaFields["BSpalte"j].Text ="\""bperiod((char)13)"Durchschnitt"bsperiod"\"" ;
    It compiles and the code is done faultless, but when the report needs to be shown,
    I get the message:
    Fault in report: .....
    Fault in formula BSpalte1...
    "Content of string
    " There is something missing..
    (i translated the message from german to english, maybe the translation is not quite correct )
    can you help me?
    Maria

    Hi,
    In SAP carriage return is represented by # symbol, when it reaches the form it turn out to be /n you dont need any script as such to see text in multiple lines.
    If you are using a textfield on the form for such data just make sure * Allow Multiple Lines * check box is selected.
    Then if the source is of n lines, the text field will represent n lines with a scroll bar respectively.
    Let me know if you need more help.
    Cheers,
    Sai

  • WD Abap - simple question (required field)

    hi folks,
    quite a simple question i guess.
    i have a field marked as required (gets a red asteriks). In the actions i have "Standard" so they should have to do all the validations, but i still can execute the action, i did not find a docu for the behaviour of the "required" features? i thought like in r/3 sapgui appl. a default error messages will be shown?
    any ideas?
    kind regards,
    oliver

    Oliver,
    I guess there is no difference between WD ABAP and WD Java in this regard, so I will answer from WD Java developer point:
    "Required" actually means visual hint to user that input is mandatory. What "mandatory" actually means is application-specific.
    For example, in Java string could be either null, or empty, or contains only spaces, or rest. What is mandatory here? Not null? Not empty? Something besides spaces? Ok, even worth, let us assume that we are entering some number (material, order). So string with only zeroes is also "empty".
    Hence WD does not handle "required" flag itself, this is left for application developer.
    Certainly, some data type constraints like minimal text length, or minimal numeric value may be treated as "required", and here WD works well.
    VS

  • Chart Expert - Why are some formula fields not available?

    I have a report where I had to do Running Totals with formulas.  Following what I learned long ago from the documentation, I laid in my formulas, and then setup some "Display" formulas to print out the results at the end of my report.
    Now I am adding a chart to show a sort of 'summarized' version of the report - its a simple Pie chart...
    But when I go into the Chart Expert and want to select those Display formula fields (there are 4 of them) - they do not appear in the list?
    FYI - These four Display formulas are in the Report Footer of the report, and my chart is in the Report Header. 
    Why do some of my formula fields appear in the Chart Expert "select field" list - while others do not?
    I checked the documentation on this, but it is very "lite" and does not indicate why this might be...
    Any help is most appreciated!

    Read again -  "Problem has been circumvented" NOT "worked around".  In other words, when you pay a fortune for a poorly documented piece of software and you are dependent on answers from a Forum, where at times no one answers your question(s) and your boss is shouting at you as to how you selected such a lousy piece of software with such "lite" documentation and is hardly going to pay any more money for a support call to answer a simple question that should have been covered (and then some) in the documentation, (let alone support of the problem) - you CIRCUMVENT, i.e. give up and find some other way to do what you were trying to do.
    Hence, problem circumvented, NOT worked around.
    Thanks for asking - here's 10 points for your efforts.

  • [CR integrated in VS 2005] - sum of string fields

    Hello,
    i am discovering CR,
    and i am trying to do the sum of a field (number) but declared as string. the declaration of the field cannot be changed (string in the database).
    so i want to do the sum of this field.
    i wonder if it is possible, and if yes, how.
    maybe something like a formula.
    I saw the functions: ToNumber () and Cdbl() for conversion, and Sum().
    If someone has an idea, i will be very interested.
    PS: sorry if my question is not understandable, i'm french. If you don't understand it, i would rewrite it.
    thank you!

    thank you.
    I could convert, but the problem is to make the sum of the conversion.
    i would like to do something like:
    Sum(ToNumber ()) but CR does not accept it.
    Maybe by using a variable in a formula (but i don't know where):
    shared numbervar total;
    total = total+ToNumber({MyField});
    and when printing a formula field at the bottom of the report to show the total:
    shared numbervar total;
    ToText (total);

  • Summarizing a formula field

    Newby question..
    I have a formula field labeled hours and consist of
    {CSC_SES3_WOI_WII_Work_Order_Join.csc_dec_estimated_hours}  *  DistinctCount ({CSC_SES3_WOI_WII_Work_Order_Join.csc_dec_estimated_hours}, {CSC_SES3_WOI_WII_Work_Order_Join.Summary})
    This is in the Group Footer 2 field.
    I now need to get a total of the hours for all the groups and put into group footer 2 field.   I can not seem to be able to add all the group footer 2 entries for hours.
    I know this should be simple, any help is appreciated
    Crystal reports 2008
    Thanks again,
    brandi

    Amr,
    Thank you for your quick response however I did add another group then added the formulated field to that section.  It is only calculating the last entry from group footer 1
    So i have a formula field (@hours) in Group Footer 2
    I created Group Footer 1 and put the same formula field (@hours) in that section. 
    My report has about 4 records in it and is like this
    Group Header 1  = Group 1
    Group Header 2 = Information of a group of tickets including a field estimated hours
    Details = details multiple entries
    Group Footer 2 = a Distinct Count field and the formula field (@hours)
    Group Footer 1 = (@hours) field
    In Group Footer 2 I have only 2 group 2 entries.
    example.
    150
    170
    In Group Footer 1 it is calculating just
    170.  Instead of adding the 2 entries together

  • Formula field, Detail records not getting updated

    Hello seniors,
    i need help on 2 issues;
    first, Issue No. 1
    i have master-detail form with the following tables;
    POH                                  master record table
    PH_NO                              pk
    PH_PARTY
    PH_FXRATE                       exchange rate
    PH_PD_LOCAL_TOT           total of PD_LOCAL_AMT  from details records
    PH_PD_FOREIGN_TOT       total of PD_FOREIGN_AMT  from details records
    POD                      Detail records table
    PD_PHNO              fk
    PD_ITEM
    PD_QTY
    PD_PRICE
    PD_LOCAL_AMT        
    PD_FOREIGN_AMT
    M_PD_FOREIGN_AMT       Formula (PD_QTY * PD_PRICE)
    M_PD_LOCAL_AMT           Formula (M_PD_FOREIGN_AMT/PH_FXRATE)
    CTRL                 Control block
    M_PH_PD_LOCAL_TOT           Summary-Sum-Table=POD, Field=M_PD_LOCAL_AMT
    M_PH_PD_FOREIGN_TOT       Summary-Sum-Table=POD, Field=M_PD_FOREIGN_AMT
    Triggers
    POH Table
    Pre-Insert   and   Pre-Update
    :PH_PD_LOCAL_TOT := :M_PH_PD_LOCAL_TOT
    :PH_PD_FOREIGN_TOT  := :M_PH_PD_FOREIGN_TOT
    POD Table
    Pre-Insert   and   Pre-Update
    :PD_LOCAL_AMT := :M_PD_FOREIGN_AMT
    :PD_FOREIGN_AMT :=  :M_PD_LOCAL_AMTThe problem that i am facing is while i UPDATE a record.
    whats happening is when the form is in Query mode and if i change a record, lets say
    change the value of the field PH_FXRATE, then what happens is, on screen i get all Detail
    record's M_PD_LOCAL_AMT Calculated & Updated, but the actual db field PD_LOCAL_AMT remains unchanged
    in the database after i press F10 or Save button.
    The update takes place for the POH table and form displays 1 Record updated.
    whereas if i have for example 4 detail records, then form should update those as well and display finally
    5 records updated is'nt it..?
    In query mode,if i insert new or modify an existing record in the detail block, then at this point, form marks just
    that particular record as CHANGED. Thus making changes at db level only for this particular record.
    what i want is once i make changes to the field PH_FXRATE, then form should mark all detail records
    as CHANGED and on saving, the PRE-UPDATE tigger of POD table should come in to force and the changes
    in the values of M_PD_LOCAL_AMT in turn to the db field PD_LOCAL_AMT should get affected at db level.
    i have also tried to put these assignments
    :PD_LOCAL_AMT := :M_PD_FOREIGN_AMT
    :PD_FOREIGN_AMT := :M_PD_LOCAL_AMT
    at PRE-UPDATE of POH table, thinking that form might consider
    all detail records, at this point. i noticed that it does it, but only picks
    1 record (i guess just the first record always) and change a db level.
    No. 2 Issue:
    i have put a POST-FORM-COMMIT at form level for auditing the Total fields of POH table against the details records.
    Declare
         M_LC_AMOUNT NUMBER(13,3);
                  M_FC_AMOUNT NUMBER(13,3);
    Begin
         SELECT SUM(PD_LOCAL_AMT) INTO M_LC_AMOUNT
         FROM POD
         WHERE  PD_PHNO = :PD_PHNO;
         IF  :PH_PD_LOCAL_TOT != M_LC_AMOUNT  THEN
              :PH_PD_LOCAL_TOT := M_LC_AMOUNT;
         END IF;
         SELECT SUM(PD_LOCAL_AMT) INTO M_FC_AMOUNT
         FROM    POD
         WHERE  PD_PHNO = :PD_PHNO;
         IF  :PH_PD_FOREIGN_TOT != M_FC_AMOUNT  THEN
              :PH_PD_FOREIGN_TOT := M_FC_AMOUNT;
         END IF;
    End;i was testing and notice that in a query mode when all records are displayed.
    if i go on changing values on records and save or save later keeping the form open,
    form allows, but if 1 come back to a record which i may have changed and saved earlier, then it flashes Error;
    "Records has been changed by another user, requery to ..."
    i want to do an Audit before final db-Commit and keep the user free from this Error..
    Please tell me first of all, is my approach for both of my issues,correct.?
    if not, then please suggest what should be changed.
    i'll highly appreciate for all your help. TYVM. Regards.

    I did exactly as you suggested. It works well for new record insertion
    but when i press F7 to query it, its flashes messages before displaying detail records
    Field must be entered.
    Mr. Andreas,
    i have problem only when i change value of PH_FXRATE. It re-calculates on screen values for M_PD_LOCAL_AMT
    (Formula M_PD_FOREIGN_AMT/PH_FXRATE)
    i want the changed value of M_PD_LOCAL_AMT to be saved in the actual db-field PD_LOCAL_AMT.
    for this i have PRE-UPDATE on POD Table
    :PD_LOCAL_AMT := :M_PD_LOCAL_AMT
    :PD_FOREIGN_AMT := :M_PD_FOREIGN_AMT
    Which is doing that.It is not marking the detial record as CHANGED.
    I tried giving the above assignments in the PRE-UPDATE on POH table.
    It saves the changed value in the db-field, but not all detail records, if more than 1.
    what you have suggested, will get me acheived what i am looking for..?

  • A simple Question about % in CR Chart!

    Hi, I have another simple question.
    When i use SQL to storage data and wanna Crystal Report to display the data in chart using %
    which data type should i use?
    float or string?
    and I found when i use 0.12 as 12% in database , It could not display in Crystal Report line chart normally.
    What should I do??
    Please Help!!!
    Thank you VERY MUCH!!!

    If you have the datatype as string from your database then try adding the string field as a summary field in chart and select maximum instead of count and if you have them in number format then you can directly select the percentage in chart.
    Regards,
    Raghavendra

  • Working with 3 Reports -- How to Display Summary/Formula field in Each Repo

    I have 3 Report that represent three Company.
    Each Company/Report has their report Details and field totals at the bottom.
    Now what I am trying to accomplish is that I need to add all three companies grand total and sum it up and display at the bottom of each reports.
    FYI, I have created matrix report and i pass user parameter where user can choose which company's report him/her would like to run so for example: if user run Company_1 then at the bottom i want to display all the companies Grand Total.Each reports have 6 columns and all the columns are same in each report except the data change by company. and with the same thing with Company_2, and Company_3
    Now, I tried to use create a separate query and tried to use DATA LINK but it didn't work due to very awkward report design.
    Is there a way where i can create a formula field and write PL/SQL and display at the bottom of my report.
    Please let me know if its possible I will very appreciated.
    Thank You

    Thanks for your reply,
    Actually, I would done that before taking Company's parameter off but i have to send out this report to all three companies thats resoan why I put companies paramters.
    Also, I have solved that problem by creating new query that will give me total off each company so in my Data Model. I have Q_1 (main query), Q_2 (Company 1 query which give me total for each field), Q_3 (Company 2 query....), Q_4
    and call those all fields and RESET AT REPORT level.
    so, no mather which company i choose in my parameter field it will give me final total at the bottom of my report for all the departments.
    Thank You,

  • Crystal Reports XI - How  to create a new field using a formula field

    I'm quite new to CR, but have been learning quickly!
    I would like to know how to automatically create a new record/field based on another field in that row...
    I have a report showing the following data:
    Run Code     Start KM    Stop KM    Status 
    H2                 100            150           Partial
    H2                 150             155          Partial
    H2                 155             160          Partial
    S3                 120             150       Completed
    The status is generated by comparing the 'Start KM' and 'Stop KM' against fields in another table called 'Start Odo' and 'Stop Odo'
    In this example...
    H2 has 'Start Odo' and 'Stop Odo' values of 90 to 160, therefore there is still 90-100 to check.  The 'Start KM' and 'Stop KM'  is equal to the 'start Odo' and 'stop Odo' for S3, therefore it shows completed.
    My question is how do you create a formula field, which will add an entire row...displaying the values 90-100.
    I've been trying to use a conditional check in the 'Start KM' column, that sees if status is equal to partial than if start km is greater than start odo (Which is the reference km) then display the value of start odo in the new row. I'm stuck at how to create a new row.
    I want the final result to look like this...
    Run Code     Start KM    Stop KM    Status 
    H2                  90              100         Partial
    H2                 100             150          Partial
    H2                 150             155          Partial
    H2                 155             160          Partial
    S3                 120             150       Completed
    Any suggestions would be more than appreciated

    Hi Adi
    Looking at your examples it seems that you want to add a row to the existing recordset (rows fetched from the database).
    If it is the case (even if based on a formula) then you can not do it within crystal. Crystal is designed to display data and ideally it should not generate the new data.
    However, as per your requirement you can try to add this logic at database end. May be a command object within Crystal Reports can help you.
    Let me know if you do not understand anything.
    Regards
    Nikhil

  • How to summarize the formula field for grand total

    Hi All
    Iam desinging a report in which iam facing a problem to summarize the formula field . This formula field contains sum calculation like
    formula name is @sales
    Sum ({@DTM200}, {@SaleMan})+Sum ({@DTM500}, {@SaleMan})+
    Sum ({@TM500}, {@SaleMan})+Sum ({@TM1000}, {@SaleMan})+
    Sum ({@HTM500}, {@SaleMan})+Sum ({@HTM1000}, {@SaleMan})+
    Sum ({@WM500}, {@SaleMan})+Sum ({@WM1000}, {@SaleMan})+
    Sum ({@CURD}, {@SaleMan})+Sum ({@Buttermilk}, {@SaleMan})+
    Sum ({@BULKWM}, {@SaleMan})+Sum ({@BULKTM}, {@SaleMan})
    the fields are summary fields and iam calculating all these fields to get the final result . Upto this it is working fine but finally i want to calculate the grand total of this formula '@sales' how should do this
    Thanks in advance

    Hi,
    If your formula name is @Sales you click the @Sales formula then Click Insert from Menu bar and click Summary.
    Then click Grand Total.
    Regards,
    Clint

  • 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

  • Need a simple answer for simple question???

    simple question... what is the best way to export my fce movie and burn it on idvd for the best quality for genaral use ... sd..4x3 ratio tv.. lots of ken burn effects on photos... lots of sd video... ???
    not so simple answer... i have read manuals.. apple discussions.. etc etc my eyes are blurry.. i have been exporting out of fce to qk time movie, then import to idvd and burn..
    i get lots of wavy or jitter when doing kens burn effects on photos.. i have been told that 1 field must be missing.. and its better to take the qk time movie convert it again making sure hi quality is checked(movie properties 720 x 480) and self contained movie, then import to imovie ver 5.02 which has better codecs then to idvd ... an apple store tech said..
    then another apple store tech said...dv pro or dv stream or interlaced or on and on and on
    its not 16x9, or for the web or anything but simply burn it and give it to my grandma to play in a standard dvd player.. best quality.. period.. i know it won't any better than my source video but the wavy photos bother me..
    help

    The Apple store tech told you garbage. The quality will be the same. It's using the same QuickTime engine. There may be a difference because going through iMovie will go through a file conversion and the picture might be softened a little, which will mitigated this flicker you see.
    The wavy photos can be a lot of things, most likely due to the nature of the images themselves and the movements you've done on them. What often works on still images is to apply a one pixel vertical motion blur in an application like Photoshop or Elements. This helps to reduce interlace flicker on motion when the material is brought into a video editing application.

  • Selecting records based on formula fields

    Post Author: Mike Kennedy
    CA Forum: Formula
    I have created a field (called "Shortage") that is the result of subtracting two running totals and have inserted all three fields into the group footer.  I only want to select those records that have a negative value as a result, but the field is not shown in the Select Expert.  None of my formula fields show up in the Select Expert for some reason (normally they do).  Does anyone know why and how can I select these records only?  Thanks.

    Post Author: SKodidine
    CA Forum: Formula
    Running Totals are only available once the records are being read and processed.  You are calculating the difference between two Running Totals and then want to use that to select records?  I don't think that is possible.  One way of accomplishing the display of groups which have a negative value is to use sum functions instead of the running totals and then in group selection criteria, display only those groups which have a negative value as a result of subtracting the two sums.

  • Formula Field Sorting

    Frield 1 is group on Date (Group1)
    Field 2 is group on workstation (Group 2)
    Field 3 is a formula field Sum(Amt).
    The Report will look like below when displaying the Group Footer #2 (workstation) line.
    Date           Workstation    Amount
    11/01/2010        A             2,550
    11/01/2010        B            55,000
    11/03/2010        D            78,200
    11/04/2010        C              5,500
    I would like to report to be sorted in decending order on the Amount field which is a formula field.
    Date           Workstation    Amount
    11/03/2010        D             78,200
    11/01/2010        B            55,000
    11/04/2010        C              5,500
    11/01/2010        A              2,550
    The Group Expert does not list the formula field as a field that can be grouped on. How can this be done?

    Hi
    I have a similar issue....
    I have a report that's looking for Turnbacks,Total Trips and Turnback Percent of total trips grouped by Vendor.
    Report Layout
    Date (Group1)
    Vendor (Group2)
    Under group Vendor I have summarized fields...
    Date 20101119
    Vendor Id         Sum of Turnbacks         T otal Trips                      Turnback Percent of total Trips
    123                   50                                  100                                       50%
    456                  10                                  100                                       10%
    789                  100                                100                                       100%
    Date 20101120 
    Vendor Id         Sum of Turnbacks         Total Trips                          Turnback Percent of total Trips
    123                   60                                  100                                         60%
    456                   20                                  100                                         20%
    789                  100                                100                                         100%
    I would like to sort the  Turnback Percent of total Trips field in descending order. But it does not appear in neither(Group or Record) sort option.
    Any help will be greatly appreciated.
    Thanks!

Maybe you are looking for

  • 11.5.10.2 Fresh install - NLS problem

    Hi all, I'm doing a multinode fresh install of 11.5.10.2 on HP-UX. Came across the following from rapidwiz (it only happens with Simplified Chinese): RW-50004: Error code received when running external process. Check log file for details. Running APP

  • Realising dynamic "popup" Elements

    Hi! Is it possible to develop something like shown here: http://www.sap.com/germany/services/education/schulungskatalog/service-oriented-architecture/curriculum.epx?context=[[CA_SOA]]| but with a dynamic view? What i mean is: First there should only

  • 16:9 footage/menu is displayed as 4:3 on final DVD

    Hello... Recently i installed Windows Vista and have been testing my adobe video products.. so far.. far better performance than XP on my dell dimension 2350. I own a sony HDR-HC3 high definition camcorder. The other day i imported the full quality i

  • I have wifi connection, but my internet is very slow

    I have wifi connection, but my internet is very slow

  • PS4 CameraRaw  permissions --- error/problem

    I have recently installed Adobe CS4 (Master Col.) and I recently tried using Bridge to open my RAW files to convert to .tif files before working on them in PS. These are the steps i am doing and the results: I change the image to 16 bits/Channel in t