Crystal Report Formula - Remove First Word

I am looking for a formula to remove the first WORD from a field.

Hi Hank, 
One way to do this is to find the first space in the string and parse out the characters before that string. 
If your string looks like, "First Second Third" try this: 
{table.FIELD} [(InStr ({table.FIELD}, " ") + 1) To Length ({table.FIELD})];
Good luck,
Brian

Similar Messages

  • Crystal Report formula with datediff not working as expected

    We need a Crystal Report formula to display the number of seconds the oldest arriving call has been waiting.  Across multiple resources that can each have an "oldest call".  The database stores a datetime value for the time the oldest call arrived.  If there are no waiting calls, then this field is NULL.  (MSSQL database).  It seemed reasonable to implement this in a formula that 1) discovers the minimum of "oldest call" timestamps in the selected records, and 2) to use "datediff" to produce the difference (in seconds) between the "oldest call" timestamp and current time.
    The first attempt at this relied on "implied" iteration that could be done within a formula.  Something like:
    data: OLDESTARRIVALTIME
           null
           '2014-06-14 08:08:08.000'
           null
          '2014-06-14 08:07:55.000'
           null
    whilereadingrecords;
    datetimevar minArrival;
    if isNull({SVCCLASSMEASURES_VW.OLDESTARRIVALTIME}) = False
                   and minArrival < {SVCCLASSMEASURES_VW.OLDESTARRIVALTIME} then
         minArrival := {SVCCLASSMEASURES_VW.OLDESTARRIVALTIME};
    DateDiff("s", minArrival, {SVCCLASSMEASURES_VW.UTCDATE})
    We tried storing the values of OLDESTARRIVALTIME in an array.  We could see it iterating, but the values in the array only contained
    the column value from the first record.
    This was to solve the problem of screening null values and producing the minimum of the set.
    Since that didn't work (and the web articles seemed to imply this would iterate over all the records, we tried another approach.  This
    time we set NULL timestamps in the table to a timestamp far in the future, so that we could directly apply "minimum" to produce
    the correct "begin" for datediff.
    data: OLDESTARRIVALTIME
              '2030-01-01 00:00:00.000'
              '2014-06-14 08:08:08.000'
              '2030-01-01 00:00:00.000'
              '2014-06-14 08:07:55.000'
              '2030-01-01 00:00:00.000'
    datetimevar minArrival = minimum({SVCCLASSMEASURES_VW.OLDESTARRIVALTIME});
    datetimevar minUTC = minimum({SVCCLASSMEASURES_VW.UTCDATE});
    if minArrival < minUTC then
         DateDiff("s", minArrival, minUTC)
    else
         0
    (minUTC would be current time in UTC)
    So, to start things off, the last formula produces negative numbers!  They hover in negative seconds within a negative minute (-33, -45, etc.).
    That's inconceivable, considering the test for minArrival < minUTC.  Both of the fields are "datetime".
    As it turns out, in the near term, it's most important to get the second formula working.  And, of course, insights into getting the first
    formula to work are welcome as well!
    Have we run into some weird behavior of the "DateDiff" function?
    Thanks!

    If DateDiff is always returning a negative number you could try swapping the dates around in the call to DateDiff - it should look like this:
         DateDiff("s", minUTC, minArrival)    
    Or you could use the Absolute Value of the calculation:
         Abs(DateDiff("s", minUTC, minArrival) )
    As for your first formula, you need to initialize the variable to a value prior to using it in the comparison.  If you don't, its value is null and comparing it against a value won't work.  (See What is Null and Why is it Important for Crystal Reports | SAP BI BLOG for a blog that I wrote about working with nulls in Crystal.)
    You should change your existing formula to something like this:
    whilereadingrecords;
    datetimevar minArrival;
    if OnFirstRecord then minArrival := DateTime(2013, 1, 1, 0, 0, 0);
    if not isNull({SVCCLASSMEASURES_VW.OLDESTARRIVALTIME})
                   and minArrival > {SVCCLASSMEASURES_VW.OLDESTARRIVALTIME} then
         minArrival := {SVCCLASSMEASURES_VW.OLDESTARRIVALTIME};
    Note how I changed the If statement.  Also, you want to replace minArrival with the field value if the field is less than the current value of minArrival - so you need to use ">" instead of "<" in the comparison.  Place this formula in the details section.  It will now show anything because of the semi-colon on the end.  This will ensure that it gets evaluated for every record.
    Now, create a second formula that looks like this:
    whileReadingRecords;
    datetimevar minArrival;
    DateDiff("s", minArrival, {SVCCLASSMEASURES_VW.UTCDATE})
    Place this formula in a footer section - it will not work in a header section.  If you need it in a header section you might be able to take the "whilereadingrecords" off of both formulas and use the "Maximum()" summary function to get the correct value.
    -Dell

  • Problem in using  Nested  IF-ELSE in Crystal Report  formula

    Hi Experts ,
                         I am having some problem using  Nested IF-ELSE in Crystal Report formula ,
    there is no error in the formula but only one condition is working. other condition is not working
    i am using this concept in formula workshop :-
    ' if{EXCISE_INVOICE;1.Basic Excise Duty BED@10 %}<>0 and{EXCISE_INVOICE;1.Education Cess @2%}<>0 and {EXCISE_INVOICE;1.Secondary Education Cess @1%}<>0 and {EXCISE_INVOICE;1.Central Sales Tax(CST)@2%}<>0
    then
    Sum ({EXCISE_INVOICE;1.Amount}) + {EXCISE_INVOICE;1.BedAmount@10%} + {EXCISE_INVOICE;1.EcessAmount@2%} + {EXCISE_INVOICE;1.SecCessAmount@1%} + {EXCISE_INVOICE;1.CSTAmount@2%}
    else
    if {EXCISE_INVOICE;1.Basic Excise Duty BED@10 %}<>0 and {EXCISE_INVOICE;1.Education Cess @2%}<>0 and  {EXCISE_INVOICE;1.Secondary Education Cess @1%}<>0 and   {EXCISE_INVOICE;1.Input VAT@5%}<>0  and {EXCISE_INVOICE;1.Addtional Tax@1%}<>0
    then
    Sum ({EXCISE_INVOICE;1.Amount}) + {EXCISE_INVOICE;1.BedAmount@10%} + {EXCISE_INVOICE;1.EcessAmount@2%}+{EXCISE_INVOICE;1.SecCessAmount@1% } + {EXCISE_INVOICE;1.VATAmount@5%} +{EXCISE_INVOICE;1.AddTaxAmount@1%(for VAT@4)}
    I want that  all conditions  should work and the condition which is applicable there according to formula it display the result,  if i add another condition then it should also work.
    kindly tell me the solution of this problem
    Regards
    Rahul

    Try this logic:
    if{EXCISE_INVOICE;1.Basic Excise Duty BED@10 %}!=0 and{EXCISE_INVOICE;1.Education Cess @2%} !=0 and {EXCISE_INVOICE;1.Secondary Education Cess @1%} !=0
    then
    Sum ({EXCISE_INVOICE;1.Amount}) + {EXCISE_INVOICE;1.BedAmount@10%} + {EXCISE_INVOICE;1.EcessAmount@2%} + {EXCISE_INVOICE;1.SecCessAmount@1%}
    else
    0
    +
    IF {EXCISE_INVOICE;1.Central Sales Tax(CST)@2%} !=0
    then
    {EXCISE_INVOICE;1.CSTAmount@2%}
    else
    IF  {EXCISE_INVOICE;1.Central Sales Tax(CST)@5%} !=0
    then
    {EXCISE_INVOICE;1.CSTAmount@5%}
    +
    if {EXCISE_INVOICE;1.Addtional Tax@1%} !=0
    then
    EXCISE_INVOICE;1.AddTaxAmount@1%(for VAT@4)}
    else
    0
    If not work, try SQL command.
    Thanks,
    Gordon

  • Crystal Report Formula to select Record  of only MAX Value

    hi Everyone,
    i need a simple crystal report formula to select one department whose recived quantity Maximum.
    for example:
    itemcode    dscription      departmen   op       recived       issue        
      1                   a                ab               2              2              2         
      1                   a                bb              0             2              2          
      1                   a                bc               4             8              2         
      1                   a                cc              2              2              2
    i group by item  the item show just once but i want a formula to show one department who's recived quantity is maximum.i suppress the detail section.and just show the group footer/
    itemcode    dscription      departmen   op       recived       issue        
      1                   a                  bc                 8             14             8 

    Thanks
    Re: Crystal Report Formula to select Record  of only MAX Value
    Abhilash Kumar

  • Crystal Report Formula field function  on OLAP SAP BI/BW Cube

    Dear All
    We create OLAP Cube Report in  Crystal Report 2008 (BO)  base  SAP ( DB2)  BI/BW  Cube, Grid report coming correctly.  Crystal Report Formula Field  functionalities are not avilabel or suporting.  If any one explain or some kind of documentation available pl.  help me.
    Thanks,   in advance.
    Alfred.M

    Hi,
    you are using the OLAP Grid which will only have limited functionality. You can use the BW MDX Driver and then connect to a BEx query and you will have the complete functionality in CR
    Ingo

  • Crystal Report Formula for traversing the Hierarchy

    Hi Friends,
    I have a Hierarchy Node Variable in Query Designer and I use the same in my Crystal Report.
    I need to create a formula, which will traverse and find all of the child nodes of the selected Hierarchy Node (through the variable). Could you please let me know if this is possible and send me the code.
    Thanks in Advance!
    Regards,
    Vinaya Paulraj.

    Hi Vinaya
    In Crystal, under the 'Report' menu, there is an item called ''Hierarchical Grouping Options'. This item allows you to sort information based on the relationship between two fields.
    For example:
    The following example is based on using the sample database called Xtreme that ships with Crystal Reports and Xtreme's Employee table.
    There is an {Employee ID} field and {Reports to} field in the Employee table. These fields both contain an Employee ID number. There can be employees with employees that report to them. In other words, there can be employees that report to a higher level of management. You want to see the overall hierarchy of the employees. To do so, you would use the 'Hierarchical Grouping Option' in Crystal Reports.
    To view the employee hierarchy from the Employee table, complete the following:
    1. Create a group and group on {Employee ID}. You want to group on {Employee ID} because you want to see the overall hierarchy of employees.
    · From the 'Insert' menu, select 'Group'.
    · From the 'Insert Group' dialog box, select {Employee.Employee ID} in the first drop-down list.
    · Click 'OK'.
    2. Create a hierarchical group.
    · From the 'Report' menu, select 'Hierarchical Grouping Options'.
    · Select 'Sort Data Hierarchically'.
    · Select {Reports to} from the drop-down list for 'Parent ID'. In this example, the {Reports to} field is the parent field; therefore, we must select it in the 'Parent ID' field.
    3. Indenting the hierarchical group, you must enter a value between 0 and 4 inches.
    The 'Group Indent' setting only affects the display of the report. If you enter a value other than zero (0) the various levels of hierarchy will appear indented when the report is previewed. Thus making it easier to see the various groups of employees, managers, etc.
    For more information, search the online help for 'Grouping data hierarchically'.
    Regards
    Girish

  • How to make Crystal Report Document from MS Word document?

    Hi
    Is it any way to use MS Word document as template for Crystal Report document.
    I can Insert document as OLE Object, but I want to disassemble it to Text Objects.
    Thanks.

    You can insert 1 page at a time as background (Insert in page header and elect to Underlay following section).
    There is also 1 3rd-party tool that can use formulas from a Crystal report to fill a template MS Word document and save/email to a new MS Word document.
    If you explain the actual end-product required by the user, it may be easier to suggest a solution.

  • Crystal report formulas to view revenue for current & Previous Year

    Hi all,
    We have a requirement to create a formula in crystal reports to display the current month revenue and previous month revenue along with few dimensions and also current fiscal year revenue and previous year.
    For ex on SAp ecc table CE11000.
    Please provide the syntax for above requirement.
    Quick response is appreciated.
    Thanks.
    DJ

    HI AlunJD,
    Thanks for your quick turnaround.
    Here's the structure of table i have fields like Currency type,Document Number,Fiscal year , Company code,country, Countrygrp,Document type, Sales quantity & Revenue.
    My requirement is to display Revenue for current Fiscal Year and Previous Fiscal year and aswell as Current Month And previous month in the same report.
    Is there any functions to create a formula to display data on above mentioned logic.
    Thanks.
    DJ.

  • Crystal Report error exporting to Word

    My company recently deployed a Microsoft Security Patch to our workstations that's causing a problem with Crystal Reports. When exporting a Crystal report to a Word file (from a VB 6 application) the following error is generated when opening the file: "You are attempting to open a file that was created in an earlier version of Microsoft Office. This file type is blocked from opening in this version by your registry policy setting."
    My company uses Crystal Reports v 8.0.1.0. Is there a more recent release that provides a fix for this error?
    Thanks.
    David
    Edited by: David Verbinski on Nov 5, 2008 10:35 PM

    I know 100mb works because I have created word document reports with that size before using the crystal export.  Just really big reports.  I'm not sure on the exact size because it doesnu2019t work but I know there is more data in the report than the 100MB report which works so it doesnu2019t work on some reports larger than that (don't know the specific size because it doesnu2019t work) sorry for being redundant.
    Not sure about a size limitation on an RTF formatted document that is saved as a *.doc (word document).
    It's my understanding that exporting to a .doc is the same as exporting to .rtf because the .doc is in .rtf format.  I may be wrong but if you change a .rtf extension to a .doc extension, you get the same thing when opening the file in word.
    When exporting to RTF format I get the same error, so I believe they are using the same or similar process.
    Yes I tried on other machines and different servers and the error only occurs when exporting large documents to word.  Small documents work fine.
    If there are file constraints in exporting to word, I believe a more distinct error message could be displayed related to the specific error.
    No I did not upgrade my pc or software, I developed the report and am running specificly for 11.5 release 2 with service pace 3 installed. 
    Thanks,
    K

  • Mapping Arrays indexing in Crystal Reports formulas and indexes

    <span style="font-size: 10pt; font-family: &#39;Times New Roman&#39;"><p style="margin: 0in 0in 0pt" class="MsoNormal">I just took a Crystal Reports Designer class today and I presented the Array Mapping technique to the instructor. Since he was very interested I decided to post it here, so more people can benefit from it.</p>  <p style="margin: 0in 0in 0pt" class="MsoNormal">This is an idea used a lot in C++. I designed a formula using two symmetric arrays. One to hold values to be used to test a condition, and a second one to hold values to be outputted when the condition is found. Since the index in the test values array for a given value to be tested matches the index of return values array of the correspondent output value, this methodology is called index mapping.</p>  <p style="margin: 0in 0in 0pt" class="MsoNormal">Here follows the code:</p>   <p style="margin: 0in 0in 0pt" class="MsoNormal">//testValues array store values to be tested in the formula</p><p style="margin: 0in 0in 0pt" class="MsoNormal">Local StringVar Array testValues :=<span>     </span>MakeArray ( "S",<span>         </span>"M",<span>    </span><span>    </span>"L",<span>       </span>"XL");</p>  <p style="margin: 0in 0in 0pt" class="MsoNormal">//returnValues array store values to be returned by the test formula</p><p style="margin: 0in 0in 0pt" class="MsoNormal">Local StringVar Array returnValues :=<span>   </span>MakeArray ( "Small",<span>    </span>"Medial",<span>   </span>"Large",<span>  </span>"Extra Large", </p><p style="margin: 0in 0in 0pt" class="MsoNormal"><span>                                                    </span>"App Type not Found");</p><p style="margin: 0in 0in 0pt" class="MsoNormal">Local NumberVar i := 1;</p><p style="margin: 0in 0in 0pt" class="MsoNormal">Local Numbervar returnIndex := -1;</p>   <p style="margin: 0in 0in 0pt" class="MsoNormal">//Loop through the entire array for each values of the field</p><p style="margin: 0in 0in 0pt" class="MsoNormal">While<span>   </span>i <= Ubound(testValues) AND returnIndex = -1 Do(</p><p style="margin: 0in 0in 0pt" class="MsoNormal">//Actual test of the values and return bellow</p><p style="margin: 0in 0in 0pt" class="MsoNormal"><span>        </span>If ToText({CUSTOMER.SIZE}, 0) = testValues<i> Then( </p><p style="margin: 0in 0in 0pt" class="MsoNormal"><span>            </span>returnIndex := i;);</p><p style="margin: 0in 0in 0pt" class="MsoNormal"><span>      </span><span>  </span>i := i + 1;</p><p style="margin: 0in 0in 0pt" class="MsoNormal">);</p>   <p style="margin: 0in 0in 0pt" class="MsoNormal">//If any value found return it, else return last value in the return value array</p><p style="margin: 0in 0in 0pt" class="MsoNormal">If returnIndex = -1 Then</p><p style="margin: 0in 0in 0pt" class="MsoNormal"><span>    </span>returnValues[Ubound(testValues) + 1]</p><p style="margin: 0in 0in 0pt" class="MsoNormal">Else</p><p style="margin: 0in 0in 0pt" class="MsoNormal"><span>    </span>returnValues[returnIndex]</p>  <p style="margin: 0in 0in 0pt" class="MsoNormal">Fell free to email me if you have questions and enjoy the code...</p></span>

    Can you help with the below?
    Group on Client/Location, Brokerage Rate, Product
    Read all records for a particular group and store each different currency in an array
    On change of group display contents of the stored array. 
    e.g.
    Record 1         ABN   AM      FUTURE RATE AGREEMENT       0.012500%      DKK  
    Record 2         ABN   AM      FUTURE RATE AGREEMENT       0.012500%      EUR
    Record 3         ABN   AM      FUTURE RATE AGREEMENT       0.012500%      GBP
    Record 4         ABN   AM      FUTURE RATE AGREEMENT       0.012500%      USD
    On change of group I would like to display the following
                            ABN   AM      FUTURE RATE AGREEMENT       0.012500%      DKK   EUR    GBP    USD

  • Need a Crystal Report formula to concatenate strings during reading records

    I have a report that takes partnumbers and cross references them with other partnumbers.
    I have this information in the details
    Partnumber   XRef                          I need this as the string
    A                  B                              B
    A                  C                              B,C
    A                  D                              B,C,D
    And then start the a new string when it gets to a new partnumber.  Does anyone know how to do this?
    Thanks
    siboyd

    Hi,
    please create a formula field named "MySharedVariableTestGroupHeader" with the following code:
    shared StringVar mySharedVar := "Start";
    Then create a second formula field named "MySharedVariableTestDetails" with the following code:
    shared StringVar mySharedVar;
    mySharedVar := mySharedVar + " Next ";
    Now create a thrid formula field named "MySharedVariableTestGroupFoot" with the following code:
    shared StringVar mySharedVar;
    mySharedVar;
    Insert the newly created formula fileds in your report as follows:
    MySharedVariableTestGroupHeader -> Group header section
    MySharedVariableTestDetails -> Details section
    MySharedVariableTestGroupFoot -> Group footer section
    Watch what is displayed in your group footer.
    I hope I am able to give you an idea about what you can do by using shared variables in Crystal Reports.
    Regards,
    Stratos

  • Crystal report formula

    hello
    i am creating a simple sum but where there is no data its placing a null instead of zero
    table
    custom_orders
    =============
    customerid number
    order1 number
    order2  number
    order3  number
    order4  number
    order5 number
    i am creating total orders formula in crystal reports
    order1+order2+order3+order4+order5
    and i am grouping by customer and adding summary by the formula
    when i summarize and when no orders i prefer to place/print zero on the crystal output rather a empty column
    Please advise
    thanks

    hello
    as test i tried this
    IsNull({test.order5})-IsNull({Test.order3})
    it thorws a popup box with message
    "a number,currency ,date -time is required here"

  • SAP Crystal reports formula fields

    hi,
        how to use formula fields in crystal report.
                         thanks & regards,vinoth

    Hi Vinoth,
    That's a very vague question.
    You can create formulae via the Field Explorer > Formula option.
    After you save and close the formula editor, you need to drag and drop the formula on the report for it to execute.
    If you need help with a formula, please post the requirement.
    -Abhilash

  • Where is the Crystal Reports formula reference zip file?

    I am just getting started in Crystal Reports and I have seen a reference to cr8_formularef.zip. This file is supposedly contains all the functions and operators in Crystal Reports. But, when I do a search for it here, all I get is a reference in the Crystal reports for Visual Studio 2005, which then tells me to go search for this file at Business Objects web site!
    Ok, where is this file? I want to download it. Thank you

    If you go to http://help.sap.com/content/bobj/bobj/index.htm, you can download the CR 10 User's Guide/Online Help at http://help.sap.com/businessobject/product_guides/ce10/en/cr10_UserGde_en.zip - that should be compatible with VS2005.

  • Using Crystal Reports formulas in Command Objects

    Post Author: Hamish
    CA Forum: Formula
    Is this possible?
    When I try and reference a formula in a command object
    something like
    select * from tablenamewhere id in (@testFormula)
    @testFormula prints out as 1,2 on the report if I remove the reference in the command object
    I get an error Incorrect syntax near @testFormula from SQL Server
    (I'm using CR XI and SQL Server 2005)

    Post Author: bryanflora
    CA Forum: Formula
    In a matter of fact, Formula is for you to calculate the result you get from DB.And if there's anything you want to pass to DB before you get result, it's Parameter.

Maybe you are looking for