Crystal Formula

I need to calculate a value in pounds where a fine has to be paid if a problem has occured in the last 12 month rolling period. 
The formula is 1.2 (x-1)
1.2. is a fixed value
x is the number ot times the problem has occured in the last 12 months (rolling 12 month period) on a particular location
1 is a fixed value
Therefore the more times the problem has occured at a location, the higher the fine
I have 2 problems;
1) I am unable to write the above formula onto a crystal report as I cannot find a function that will allow 'to the power' of a number.
2) I am unable to establish the value of X  (the number ot times the problem has occured in the last 12 months (rolling 12 month period) on a particular location). My field names are probdefn.probcode (the problem), probdttm (the date it occured), comparea.unitdesc (the location). I have tried to calculate this using a subreport but I don't seem to be getting the values I am looking for, and I seem to have all of the subreport data showing in my main report instead of just the X value.
Any assistance would be gratefully received

Thanks for the help!
I tried your suggestion and it nearly worked. The formula gave me an error message stating 'there must be a group that matches this field'. I adapted your suggestion slightly by inserting a prob code group  under the location group and using the following formula 1.2 ^ ((DistinctCount ({CUSTPROB.SERVNO}, {@PROBDEFN.PROBCODE}))-1). The field CUSTPROB.SERVNO is a customer call reference that is generated every time a new problem occurs. This works really well. I have called this formula the 'ramping' calculation and will use it to multiply against a basic cost to work out the overall cost of a problem. Thank you!
I now need to report on a daily/weekly/monthly basis. I need to display a line item for each problem that has come in during the reporting period (CUSTPROB.PROBDTTM) but apply the ramping factor if the same problem occured at the same location in the last rolling year to the line item I am reporting. So for example, if a problem was reported in on 1/1/09 and there had been 10 occurences since 1/1/08 it would have a ramping of 1.210, if the same problem had occured at the same location on 1/2/09 and there had been 2 occurenced since 1/2/08 this line item would have 1.22 applied to it. How would I select my report to show me occurences that were reported in during the last month but ask it to look at the occurence in the last year for each line? Would this be a new report looking at the calculation we have just solved in a sub report?
Any more advise much appreciated.
Regards

Similar Messages

  • Native Crystal formulas don't work if VB6 is producing the report

    Post Author: pdavis
    CA Forum: Crystal Reports
    I just upgraded from Crystal 6 to Crystal XI (enterprise). (Yeah, OK. I don't rush into things.) About 70 reports apparently converted OK, i.e., they worked when looked at in Crystal design mode. Most have built-in formulas.
    Using VB6 to produce the reports (the reports are NOT embedded into the VB project via the Crystal designer; instead I'm creating a Crystal Reports object), none of the built-in formulas work (altho everything else about them looks fine). I can pass data to any of the built-in formulas (including being able to pass the code that originally constituted the formula) and the report will look fine, but I lose the flexibility to simply distribute new reports if I have to build the reports or their formulas into the project.
    I've scoured every resource I can find and have seen nothing suggesting this is a common occurrence, so I'm assuming it must be something I'm missing, something possibly subtle? Having just migrated, I'm sure there is lots about Crystal XI I don't know yet, but I would be extremely grateful for any help since I'm under deadline. (OS is Win2K server if that matters.) Thanks.

    1. You will find this option beside ? in Add-Ins. In that Settings --> BW Server Connection.
    + Not I didn't find... for example I saw... File.. Edit...view.. Insert... and others exactly like when you enter in excel ... the only difference it's that I saw activated the tool bar for bex analyzer.. on where I saw .. design mode... refresh..etc.+
    2. If you select the field in Free characteristics and restrict it with a variable in query designer mode, you will get that characteristic in variable screen and you can give the selection and you will not get that charcteristic in the output as you have taken that in free characteristic. Only if you do drilldown accross rows for that characteristic, then it will appear.
    If you take that into Rows in query designer mode, then you will get the same for variable selection and as well as in the output without drilldown accross rows. It will be displayed automatically.
    +The clear example is:  I have one free characteristic in report, like 0MATERIAL, this characteristics didn't have any restric value... then the user add 0MATERIAL into report just for see more details... later if the user filter 0MATERIAL with some values and click ok, the column 0MATERIAL dissapear from the report +
    did you have another idea to solve this?¡
    Thank you a lot.
    alice

  • Crystal Formula to convert WEEK # to the corresponding Date

    I am trying to see if it is possible to take a week number and then show the corresponding date for the beginning date?
    I have the week number for a transaction, but now I need to show the week beginning (Sunday) and ending date. Is this possible in Crystal?

    Hi
    Try something like this
    datevar yearstart := date(year(currentdate),1,1);   // Set the start date to the first of the year
    numbervar weeknumber := 20;     // This would probably be obtained elsewhere but use week 20 as an example
    dateadd("ww",weeknumber,yearstart)
    Rob

  • Data type of Crystal syntax formula

    Post Author: gpeters
    CA Forum: General
    How do you control the data type a Crystal formula returns?  I'm relatively new to Crystal.  I'm developing a formula, and initially I'm having it return Boolean values.  However, my intent is to have it eventually return a string value.  Now, it seems that no matter what I do, this formula is determined to only return a Boolean value.  Should I have used Basic syntex instead?  Very frustrating to be fighting syntax stuff.

    Post Author: CoolTowers
    CA Forum: General
    Generally strings are used with text such as address blocks, names, etc. Crystal interprets anything in quote marks as a string; then you just add them together.
    You can try the ToText function to convert other data types to a string data. For example:
    "Thanks for purchasing" + ToText({lastyear.sales}) + "in parts last year".  
    Look under the Function Tree box under Strings, then ToText for ways to use the function.

  • Return data type in Crystal syntax formula

    Post Author: gpeters
    CA Forum: Formula
    How do you control the data type a Crystal formula returns?  I'm relatively new to Crystal.  I'm developing a formula, and initially I'm having it return Boolean values.  However, my intent is to have it eventually return a string value.  Now, it seems that no matter what I do, this formula is determined to only return a Boolean value.  Should I have used Basic syntex instead?  Very frustrating to be fighting syntax stuff. 

    Post Author: SKodidine
    CA Forum: Formula
    If you could copy your formula here then it would paint a better picture to help you out.  In general, you can change the data type to string (totext) and also to number (tonumber) in a formula.  It all depends on what you are trying to accomplish.

  • Putting Parameter into SQL Expression or convert to formula Basic or Crystal

    Post Author: yoschua
    CA Forum: Formula
    Hello,In my old report I got something like thisSELECT MIN(cast("ParDyn"."ParVal" as integer))FROM "result".ParDyn WHERE "ParDyn"."ParNo" = (SELECT Max("Piece"."ParDynNo")                          FROM "result"."Piece"                           WHERE "Piece"."RequestNo" = XPARAM1 And "Piece"."PieceNo" = XPARAM2)      And "ParDyn"."ParIdent" = 'Trace.Assignment'  This report are viewed from VB component - at old VB they read SQL from report, input XPARAM1 and XPARAM2 and put it into report again and the show report.Because now I want to make my aplication I convert this report to use it not only at this old aplication, but with CR Viewer too.I see I can not insert Parameter into SQL Statement, so I need to use Basic or Crystal Formula.I try to make something like this : minimum({ParDyn.ParVal})and {ParDyn.ParNo} = 0of cource zero should be exchange with next statement, but this not working.What I would like to get is only one record, I do not want get whale table into CR engine and then evaluate becouse this report must work on slow connection, so I need take from database only records witch I need. Can someone help me, or show how to insert into formula value as parameter taked from another table dynamicly ?? Best Regards Bartłomiej Jóźwiak 

    Ok,
    The only way I found to get the maximum status date of an employee with the date entered in parameter was to litteraly put each employee ID, and Status Date in the Detail section.
    Then in the select expert create the parameter date.
    Then I created a running total field that counts the employees and resets on change of employee sorted by status date.
    Then I created a formula that gets all the first occurences of this running total field and if the running total field equals 1, a new formula field shows 1 and if not (2 and more), it shows 0.
    But I can't find the way to give me the total that I need for each group sections.
    It's ok if the SQL expression field does not work, but I need to find a way to get the max date.
    Thank's for your help for the SQL Expression field.
    Steph

  • Hyperlinks do not work when exporting to PDF (Crystal and Visual Cut)

    I have a question about Crystal Reports XI Release 2 and Visual Cut 11. I create reports in Crystal and export them using Visual Cut. Some reports contain hyperlinks to files on a network drive. However, the links only work while in Crystal. The PDF files that are printed through Visual Cut display the links, but they are not clickable. How can this issue be fixed?
    In case it helps, the links also work when I export reports from Crystal to HTML, Word, and Excel, but not when I export to Acrobat. I believe it is a problem with tagging/accessibilityfeatures. So is there a setting/formula in Crystal or Visual Cut that would allow the exported PDF files to be accessible?

    While Crystal exports to pdf indeed lose hyperlink functionality (both in Crystal as well as in Visual CUT), Visual CUT allows you to use Crystal formulas (acting as hidden Tags) to create hyperlinks in the resulting pdf file. Another option supported by Visual CUT it to automatically detect file references in the pdf text and turn them into hyperlinks.  Contact MilletSoftware for more detail.
    Edited by: Ido Millet on Oct 27, 2010 5:11 PM

  • Images in Crystal Report

    I wonder if there is any way to display the images in exactly the same dimensions as it was originally saved that is if the image s saved it should display as small and if big it should display as a big image

    One of the 3rd-party Crystal Reports Desktop Schedulers listed at http://kenhamady.com/bookmarks.html provides a solution for your use scenario.
    It allows you to automate the process of exporting a report to pdf and then inserting images based on directives provided by Crystal formulas.

  • Programatically Rename Exported Crystal Report File

    Hi All,
       In my VB.NET code, I am trying to rename the CrystalReportViewer1.Id so that when a user exports a file, it will be named with the name of the report plus a parameter that they ran the report on. When testing my results, I get "Value cannot be null. Parameter name: inputString" on my web page. My question is where should I be inserting the CrystalReportViewer1.Id  code so that it can work and without the error message?
    Thank you in advance,

    Hello Antoine
    I just played with that API last week. All I did is place it just before setting the report to the viewer:
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            Dim crReportDocument As New ReportDocument
            crReportDocument.Load("C:\Crystal\formulas.rpt")
            CrystalReportViewer1.ID = ("Formulas")
            CrystalReportViewer1.ReportSource = crReportDocument
    End Sub
    Now, remeber this is only for web apps...
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • Opening HyperLinked Files contained in a database field Automatically alongwith Crystal Report

    Hi
    I am using Crystal Report 2008. We have a database table which has Bill of Material for all the parts, the table also has additional field which contains LINK to PDF File (i.e. c:\PDFFiles\XPart.PDF) which is containing Part specifications. Now i am able to create a Hyperlink from this field and user is able to click on the field to open the file.
    Is there a way, that all the associated linked files open automatically whenever a user previews this report.Any help would be highly appreciated.
    Thanks
    Shekhar    

    You can achieve the desired behavior by adding a UFL (User unction library) that includes a function for triggering and passing parameters ot a different process.
    At least one of the 3rd-party UFLs listed at Crystal Reports viewer comparison, Crystal Reports scheduler comparison and other utilities ( viewer and scheduler compa… provides such a function.
    You would then be able to add Crystal formulas that result in opening linked documents as a byproduct of previewing the report.

  • How to display infinity symbol in Crystal Reports using PDF as output

    Hi
    I need to show infinity symbol (u221E) in reports. I am using a formula and based on certain criteria i have to display infinity symbol.
    If (somthing ) then show 'Error' (String)
    else if something then 'u221E' (String)
    This works fine in RPT file preview , but when opens in PDF , it shows ? mark as if not understood.
    I used ChrW (Number) but it has until 255 and does not have a number for infinity
    Can someone let me know how do i do this

    Thanks for your reply
    The version is JRC 11.8.4.1197
    It would not be feasible to upgrade at this moment, we are already in production and need a solution for showing infinity in PDF.
    Can you suggest something using crystal formulas could be possible or any other solution please .

  • Crystal reports - how to identify a sequence gap within a column

    I am working on a project which requires the ability to identify gaps in numeric sequence within a column.
    Does anyone have any thoughts on what a formula such as this?
    It can be done in excel using the formula columns in screen shot columns I and J. I is H2+1 starting on I3. J is column I - column H to identify sequence gap size.
    Id like to accomplish the same using a crystal formula if possible.
    Thanks in advance.
    Regards,
    Joe

    Hi Joe,
    Here's what you need to do:
    For Column I, create a formula (@I+1) in the report with this code and place it on the Details Section:
    whileprintingrecords;
    numbervar x;
    if onfirstrecord then
         x := {Trans_Num};
         0;
    else
         x := x + 1;
    2) Create another formula and place this beside the above formula:
    EvaluateAfter({@I+1});
    numbervar x;
    if onfirstrecord then
         0
    else
         x - {Trans_Num};
    -Abhilash

  • Crystal Reports XI - How to pull same column value with different select...

    I have a report with many (around 30) sub reports and it is giving serious performance issue. I am currently finding out a strategy to improve the performance. I see that most of the sub reports are taking same parameters from main report except for one parameter which is different for each sub report and hard coded in them and pulling up the same column value from a oracle database with a different select criterion. I am trying to find out a way using either of command/crystal formula/SQL expression which can do the same job for me and give me performance improvement. I tried to take the parameters from the main report in one sub report and mapped them to parameters being transferred to the command and then drag and drop the field for which I need to display the value but due to some reason it is not returning values when I am trying multiple commands...I need some help in selecting a strategy for this issue resolution and some guidance....Any help would be highly appreciated....

    My version is 11.5.8.826. First of all I need to make it clear that I have 6 set of sub reports and each set has 5 sub reports. So if I can resolve the issue for one set, I resolve it for all. The sub reports are doing nothing but fetching a column value using a simple SQL SELECT query and appending to the right of a box in main report. The issue is that all these queries embedded into the sub reports are using same SQL except for one parameter in the "where" clause and they are fetching same column value from the database and fortunately all of them are returning same number of results. So at the end these results create a table when run. The only way I can stop using sub reports is by creating a table in the main report and use some object(formula/command/SQL expression or whatever) to fetch that column value using the same filter conditions. But please take a note that I need to use and append the same column value from a database table and use different filter conditions and append them to the right so that at the end they create a table...as long as I get the table in the output with a decent performance , anyone will be least bothered about what I used inside the report.....please ask me as many questions to get more lights on the issue....

  • Question offsets - need to determine how to reference in formulas

    I am using Crystal XI with a sequel database and have been unable to determine how to reference question offsets in a formula.
    Example:  Question 100 in the table is Appraisal Fee.  However, question 100 has several offsets.  Offset .01 is Appraisal Cost, Offset .02 is seller paid amount, Offset .03 is lender paid costs, etc.
    The sequel database table contains question 100, but not entries for any off the offsets.
    I need to reference the offsets in a Crystal Formula.  Should I be able to do that without having the table updated to include entries for each offset?  If so, helping me understand how would be greatly appreciated.

    Hi Diann,
    Sounds like you need a big, ugly Case statement. If I'm understanding correctly, essentially you are trying to create a column with the offset label in it. The only way I can think of to do this is something like:
    Create  formula field called Offset, then define the formula simlar to below:
    select
    Case "Appraisal Cost" : "01"
    Case "Seller Paid Amount"  :  "02"
    Case "Lender Paid Costs"  : "03"
    Default  :  "99";
    You could then use the Offset formul field as either a group in your report, or at least as a sort order for the records. You could also use it in other formulae.
    Hope that helps!
    Regards,
    Jim Payton

  • SQL Expression Question

    To the forum members
    In the Crystal Formula Editor, under Print State, there is a function called Previous.  This compares the contents of the current field to the previous one.  Is there a similar function in the SQL Expression Editor.  I'm trying to use a Case When statement to compare the current value in two fields to their previous value.  If these values do not match I need the SQL Expression to add 20 fields together and display the total.
    Thanks in advance.
    B.

    good sql forum
    http://www.sqlteam.com/forums/forum.asp

Maybe you are looking for