Formula Workshop Question

Hello,
I have a report to get my next ten days for Shipments for our Logistic department here.  I am looking for the following values in a fields that would equal: REJ, JEMS, or REWORK.
This is what I have:
\\Find JEMS\\
if {V_INV_LOC.INV_LOC}="JEMS" then
{V_INV_LOC.ORD_QTY}
else 0
\\Find REJ\\
if IsNull({V_INV_LOC.INV_LOC}) or Instr({V_INV_LOC.INV_LOC},"REJ")<=0 then
0
else
{V_INV_LOC.QTY_OH}
\\FIND REWORK
if IsNull({V_INV_LOC.INV_LOC}) or Instr({V_INV_LOC.INV_LOC},"REWORK")<=0 then
0
else
{V_INV_LOC.QTY_OH}
I have this in three separate Formula Fields.  What I would like to combine these three into one Statement then to store the values it finds into place holder to print off in report.  Still new at this stuff and not sure how to go about it. I know in access it would just put this into on big IF statement then declare the values to print them off later on.
This current method I am using it putting duplication values in my report which I don't need.
Any direction would be helpful.
Thanks in advance.
Gerald

Hi Gerald,
Please see if this works:
whileprintingrecords;
stringvar jems;
stringvar rej;
stringvar rework;
\\Find JEMS\\
if {V_INV_LOC.INV_LOC}="JEMS" then
jems := {V_INV_LOC.ORD_QTY}
else if \\Find REJ\\
if Not(IsNull({V_INV_LOC.INV_LOC})) or Instr({V_INV_LOC.INV_LOC},"REJ") > 0 then
rej := {V_INV_LOC.QTY_OH}
else if \\FIND REWORK
if Not(IsNull({V_INV_LOC.INV_LOC})) or Instr({V_INV_LOC.INV_LOC},"REWORK") > 0 then
rework := {V_INV_LOC.QTY_OH};
You can then create a formula that refers to each of those variables and have them printed in the report.
whileprintingrecords;
stringvar jems;
-Abhilash

Similar Messages

  • Crystal Report XI Formula Workshop Window disappeared

    I'm been trying to write a report using Crystal Reports XI.  Which I am having problems with, but at this time my main concern is... whenever I click on the Formula Workshop the application totally hangs and the box never comes up.  You can here it beep like the window should be hiding but I have been unable to find.  I usually run 2 screens and it is not on the other screen.  I am a PC person more than a Crystal Report person and can't find it anywhere.  I tried to run a repair and that didn't work either.  I can kit esc to unlock everything but i need this to build some formulas.  Suggestions?

    Hi,
    That's usually because the Formula Editor is 'lost in space'. Here's are two ways to get around this:
    Resolution 1:
    1) Open Crystal Reports on any machine with dual monitor setup
    2) Click on the Conditional Formatting button (x+2) of any field
    3) Now, with Crystal Reports open and in focus use Alt + Space, then M, then Arrow key, and then move your mouse around
    4) The Formula Editor window which was earlier off-screen should appear from one of the sides of the screen
    5) Re-open the report and the Formula Editor should show up on the Primary Display hereafter
    Resolution 2:
    1) Open the Registry Editor (Start > Run > regedit)
    2) Browse to HKEY_CURRENT_USER\SOFTWARE\BUSINESS OBJECTS\SUITE 11.0\Crystal Reports\Formula Workshop
    3) Change the value data for Editor Position as 10,10,10,10
    Let me know how this goes!
    -Abhilash

  • "SQL Expression Fields" branch missing from Formula Workshop/Field Explorer

    Hello,
    I am using Crystal Reports XI R2 SP3.  Some recent information I have seen suggests that I should use a feature called "SQL Expression Fields".  If I search the built-in Crystal Report help for "SQL Expressions", on the help pages I see that there is a "SQL Expression Fields" branch in the left pane of the Formula Workshop, just under Formula Fields and just above Selection Formulas (it's unfortunate that I cannot embed a bitmapped screen print of this).  The left pane of the Formula Workshop looks like this:
    Report Custom Functions
    Repository Custom Functions
    Formula Fields
    SQL Expression Fields
    Selection Formulas
    Formatting Formulas
    However, in my local copy of Crystal Reports the SQL Expression Fields branch does not exist - the left pane of the Formula Workshop looks like this:
    Report Custom Functions
    Repository Custom Functions
    Formula Fields
    Selection Formulas
    Formatting Formulas
    Is there some special patch, add-in or plug-in that's necessary to enable this functionality?
    Thanks in Advance,
    Bob Gardner

    I set up a DSN to a local MS Access database and used it for an ODBC connection.  Once connected, the SQL Expression Fields branch was available in Field Explorer and Formula Workshop.
    But I am developing reports for an ERP system that uses Oracle 10g databases - I have no choice but to use Oracle 10g databases as data sources for my reports.  I am not sure how to set up an ODBC connection to an Oracle database as I have never had to do so - will SQL Expression Fields not work with the native Oracle driver?
    Thank you,
    Bob Gardner

  • How to  create a Select in Formula Workshop - Record selection editor

    In the Formula Workshop u2013 Record Selection Formula Editor I am trying to write a formula to exclude certain customer ids. Iu2019m getting errors when I click the Check formula button. The statement is below, any suggestions?
    I dont think I can use the Select statement in crystal as you would in SQL but how should I write it in crystal format?
    not in (select { STATISTICS.custid} from  
        where { STATISTICS.date_reg} >= '27-may-2011' and { STATISTICS.date_reg} < '30-sep-2011')

    Hi,
    You can try the below logic:
    STATISTICS.date_reg} >= '27-may-2011' and { STATISTICS.date_reg} < ' 27-June-2011'
    I guess you are trying to apply this condition.
    Here in selection formula you need not to give select and from.
    Cheers,
    Kiran

  • Inner select and select in "record selection"- Formula workshop problem

    Hi,
    I am facing a bit tough situation in creating a Crystal Report.
    I have two queries which I need to accommodate in the Report according to a given parameter (selectionParameter).
    The queries are as follows:
    select total, minvalue, customer
    (select  sum(A) TOTAL, min(B) minValue, C customer
         from table1, table2
         where table1.A = table2.E
         AND B in (Select B from table3 where F=10)
         group by C
    order by total, minValue
    select total, minvalue, customer
    (select  sum(A) TOTAL, min(B) minValue, C customer
         from table1, table2
         where table1.A = table2.E
         AND C in (Select C from table4 where G=20)
         group by C
    order by total, minValue
    These queries should be executed according to the selectionParameter set to 0 or 1. The only difference in these queries in one of the where clauses. In the formula workshop "record selection"- I have put an if clause.
    if(selectParameter = 0) then (B in (Select B from table3 where F=10)
    else C in (Select C from table4 where G=20).
    This is not supported, since select statement cannot be used in the formula workshop!!.. And also, I have understood that what ever procedure I have been following is completely wrong, since the where clause written in "record selection" formula workshop applies to OUTER SELECT, but not to inner select, which is not what I want!!.
    Please help me to solve this puzzle. I am eagerly waiting for a solution.
    Thanks and Regards,
    Janakiram Dandibhotla.

    A command object is really the only way to create a custom SQL query in Crystal Reports.  You have the option to create a command object after you connect to your datasource.
    Alternatively you can create a JavaBean class, create the custom query in the java page, retrieve the resultset, and use that in the report.

  • Formula Variable Question

    Hi
    I have to calculate No.Of Days Open for a Case. We have Created Date and Closed Date Characteristics.
    Calculation:
    Closed Date - Created Date (If Closed Date is not #)
    else
    Current Date - Created Date.
    I have created two Formula variables on Created and Closed Dates and Used Current Date SAP Exit variable.
    Formula1: Current Date - Created Date
    Formula2: Closed Date - Created Date
    RKF1: Formula1 and Closed Date = #.
    RKF2: Formula2 and Closed Date NE #.
    No.Of Days = RKF1+RKF2
    Whenever Closed Date is blank, Formula 2 is giving "Does Not Exist" in the Output.
    I tried with NOERR, DELTA functions to get zero value in Formula2 for Closed Date = #
    But none of them worked. Surprizingly If I pull Closed Date into the Report, it is showing zeros.
    Can anyone guide where I am doing mistake?
    Best Regards,
    Sree

    HI Parth,
    I am having one issue in CKF.
    Original data:
    Compcode   Caseno.     CreatedOn    Amount
    1000         A        06/18/2011     100
    1000         B        06/19/2011      50
    1000         C        06/18/2011     150
    I have created one CKF for No.of Days Open. It is difference of Sy-datum and Created Date. I used two formula variables and used
    them in the CKF.
    Let us say today is 06/22/2011
    Report Layout:
    Caseno and CreatedOn are Free Characteristics
    Compcode  No.of Days Open   Amount
    1000          4              300
    When I bring in the Case no I am getting below result: It should show No.of Days Open as "3" for Case B. Somehow it is always
    taking maximum difference number and showing for all cases.
    Compcode   Caseno.   No.of Days Open  Amount
    1000         A           4            100
    1000         B               4          50
    1000         C               4            150
    When I bring in Createdon then only it is showing correct value for all cases. I tried with Exception Aggregation with reference to Caseno.
    CreatedOn etc but didn't get the correct result.
    Question: Could anyone identify the problem in my Query design? Thanks for your help
    Best Regards,
    Sree

  • Formula Time Question

    Hi Folks
    I have a question regarding adding in a time formula to my Select Expert in a report I have created.
    Basically this report pulls information regarding care visits from an SQL 2005 database. Everything is working fine apart from one small problem which is to do with time.
    To run this report users are required to select a client and a date range and then the report will show all the care visits for that client. Usually (and as an example for my problem)  they will run the report for a period of a week i.e. Monday midnight to the following Sunday ideally to 11.59pm - this is my problem.
    I basing the following dates on 2008.
    To demonstrate the problem there is a visit in the database that runs from Sunday 11th May at 21:15pm to 07:15am the following day which is Monday 12th May.
    At the moment if the users run this report from Monday 5th May to Sunday 11th May the report breaks the last visit into two i.e. 21:15pm to 00:00 (Sunday 11th May) and then from 00:00 to 07:15am (Monday 12th May)
    I want the report to only show the 21:15pm to 00:00 on the Sunday 11th May night. The rest of the hours would be shown in the second week i.e. Monday 12th May to Sunday 18th May
    Below shows my current "select expert" formula which is where I think I need to add the time formula - can anyone point me in the right direction. Hope the above makes sense.
    Thanks
    Andy
    {Client.LastName} = {?Client - LastName} and
    {Client.FirstName} = {?Client - FirstName} and
    {Visit.ActualStartTime} >= DateTime ({?Date From}) and
    {Visit.ActualStartTime} <= DateAdd ("d", 1,DateTime ({?Date To}))

    Andy,
    I don't see how you are having this problem. If you are basing you your selection criteria on the {Visit.ActualStartTime} only, it shouldn't matter how long the visit duration is. I'm assuming that {Visit.ActualStartTime} is a time stamp with a precision of .000 seconds.
    My guess is that your system / application is creating separate records for the same visit if  the visit covers multiple dates.
    Good luck,
    Jason

  • Apple Store Workshop question

    I'm interested in working at the Apple Store as a Creative.
    Are the workshop instructors given Apple Training Series books to teach from or are they making their own curriculum?
    I'm doing some preparation and have a gotten a couple certifications, hopefully this should increase the odds of getting hired.
    Anyone know what else they look for in new employees?
    Marvin Rocks -

    Maybe i'm over thinking this Apple job idea.

  • Categorize and count each using Formula Workshop

    Hi, I am trying to categorize all records like this
    Formula name is called SLA
    IF {F_TASKS.TA_STATUS}in["ACTIVE","ASSIGNED"]
    AND {SLA_Task_Performance.TaskPerfSLAFixDate}  > CurrentDateTime
    THEN 'SAFE OPEN'
    ELSE
    IF {F_TASKS.TA_STATUS}in["ACTIVE","ASSIGNED"]
    AND {SLA_Task_Performance.TaskPerfSLAFixDate}  <=  CurrentDateTime
    THEN 'FAILED OPEN'
    ELSE
    IF {F_TASKS.TA_STATUS}IN["COMPLETE","HISTORY","CANCELLED"]
    AND ({SLA_Task_Performance.TaskPerfFixDate} <=
    {SLA_Task_Performance.TaskPerfSLAFixDate})
    OR ISNULL({SLA_Task_Performance.TaskPerfFixDate})
    THEN 'SAFE CLOSED'
    ELSE
    'FAILED CLOSED'
    After putting SLA to crosstab header, counts for each categories are shown depending on what category it is. However, I only want to show SAFE CLOSED.
    I did try to use specified SAFE CLOSED from the grouping option and disregard others, to get its percentage. However it doesn't get the exact percentage of only SAFE CLOSED. as it only gets the 100%.
    Can anyone help me to get the exact percentage of only SAFE CLOSED?
    Many Thanks

    Hi Abilash,
    Please check the screenshot below.
    this shows when I remove the FAILED CLOSED,SAFE OPEN and FAILED OPEN in the grouping.

  • Numbers Formula/Condition Question

    I've created a small calendar in Numbers, would like to know how have the numbers (representing the day) gray out (or become a strikethrough character) as that day passes.

    If the cells contain actual Date and Time values, you could use the conditional format rule(s) shown below:
    Conditional Format rules are set in the Cell Format Inspector.
    Regards,
    Barry

  • Working days formula and Crystal 7 - is it possible?

    Post Author: Tim F
    CA Forum: Formula
    Hi folks,
    Really hope someone can help, I'm struggling with writing a report that needs to show the difference between two dates in working days. I've found the same formula posted here several times but cannot get it to return a logical value in my report. I'm wondering if that might be because I'm using an older version of Crystal? The formula in question is this one:
    //Main formulaWhileReadingRecords;Local DateVar Start := ({PPV_COMPLAINTSEH.DTRECD});   Local DateVar End := ({PPV_COMPLAINTSEH.ACTCMPLTD}); Local NumberVar Weeks; Local NumberVar Days; Local Numbervar Hol;DateVar Array Holidays;
    Weeks:= (Truncate (End - dayofWeek(End) + 1 - (Start - dayofWeek(Start) + 1)) /7 ) * 5;Days := DayOfWeek(End) - DayOfWeek(Start) + 1 + (if DayOfWeek(Start) = 1 then -1 else 0)  + (if DayOfWeek(End) = 7 then -1 else 0);  
    Local NumberVar i;For i := 1 to Count (Holidays)do (if DayOfWeek ( Holidays&#91;i&#93; ) in 2 to 6 and      Holidays&#91;i&#93; in start to end then Hol:=Hol+1 );
    Has anyone come across an alternative way of doing this, or have any ideas why this formula is not working in my report? Any advice would be much appreciated,
    Regards,
    Tim

    Post Author: Charliy
    CA Forum: Formula
    You set up a Running Total.  Drag the filed you want Summed, Select Sum as the operation if that is not the default.
    Just below that you weill see Radio Buttons that say For Every Record, On Change of Group, On Change of Field, Use a Formula, etc - click the one that says Use a Formula.  The Blue Bos to its right will turn Red, click on it, this is where you put your formula: NOT(DATEPART('w',{table.date}) IN &#91;6,7&#93;)
    Save that, then just decide if you want it reset on a Change of Group, or Never (Grand Total).  Give it a name and put it on your report.

  • Crystal Reports 2008 Can not edit in the formula editor? Help?

    I just used Crystal 2 weeks ago just fine. Now when I go into a report and then into the select expert then into the formula editor it will not let me edit my formulas. The cursor is there, but I can do anything. I tried to find and replace, but I get the text is read-only. How the heck do I fix this? It's pretty urgent.
    Edited by: Ludek Uher on Jan 6, 2012 8:58 AM

    Hi,
    The only time I've seen formula grayed out is when I go into a conditional formatting formula and try to edit other formula fields on the Report.
    What formulas are you trying to edit? The best place to edit a formula is from the 'Formula Workshop'.
    Report > Formula Workshop; you can edit any formula from here.
    Hope this helps!
    -Abhilash

  • Creating a SQL Expression Formula

    Post Author: edt11
    CA Forum: Formula
    I need to due a lookup on name(stored in a different table).  I want to display the name result on the report.
    I have tried using the following SQL:
    SELECT distinct(a.short_name) FROM FUND A, FUND_EXTERNAL BWHERE A.FUND_NUMBER = B.CUSTODIAN_KEY
    And I keep receiving an ORA-00936 error (Missing Expression).  If there is a way to retrieve this info in a normal formula that would be great as well.  But the SQL above gives me the results I am looking for so I didn't exhaust all solutions in the Formula Workshop.
    Thanks

    Post Author: edt11
    CA Forum: Formula
    I need to due a lookup on name(stored in a different table).  I want to display the name result on the report.
    I have tried using the following SQL:
    SELECT distinct(a.short_name) FROM FUND A, FUND_EXTERNAL BWHERE A.FUND_NUMBER = B.CUSTODIAN_KEY
    And I keep receiving an ORA-00936 error (Missing Expression).  If there is a way to retrieve this info in a normal formula that would be great as well.  But the SQL above gives me the results I am looking for so I didn't exhaust all solutions in the Formula Workshop.
    Thanks

  • Group Sort on formula field

    I am using CR Professional 11.5 on Windows XP/Progress platform.
    I have a formula field that calculates the GM% on the Employee Group Footer level and want to sort the employees in descending order by GM%.  I have gone in circles trying to calculate this field differently in order to be able to perform a Group Sort but this GM% cannot be summarized, which would allow me to use the Group Sort Expert.
    The fact that GM% is used in businesses world-wide each and every day makes this unbelievable that it should prove to be this difficult.  Is there something that I am missing as a newbie to CR design? 
    Any help provided is greatly appreciated!
    Marlene Human

    That's so awesome!  If only I knew how to use sql commands!  Everytime I try to create one it has errors that I dont' understand.  Do you know of a site for sql syntax that might help me to do this?  I have looked and can't find what I need to make this happen.
    So what I need to do is to use 'Formula Workshop' and create a new SQL Expression Field?  Using the formula above, how would this look in SQL?
    Thank you so much for your help...I am so grateful!!!  I have been working on this for months and keep hitting this snag.  I first started out using a cross-table and got confused because you can't summarize the GM% so I then changed the summary to 'weighted average of GM% with Tech/Rev' so that helped, but the Total per Employee has been keeping me stumped. 
    Thanks again.

  • Question on Cast & generics

    Only an unfinished idea (formulated as question in a may be wrong forum):
    One of the big strength of generics is, that explicit cast may be avoided in many cases.
    From day one Java inserted cast by itself where possible and clear. Using + in print() for all
    kind of objects is a cast to (String) and this is handled via a special methods toString()
    in Object.
    I was always wondering, why a cast to type T is not treated as a "normal" operation , in case
    where the cast is not well specified in the language or via generics. Now it inevitably leads to
    an exception, without even sending a cast-message to the object.
    Would it not be much more OO/Generic, to call something like <T> T cast(Class t) method
    located in Object with a default behavior (throwing an cast-exception), which can be overriden
    in classes to react individually on those casts, and not only in the special case +(String)object
    by calling object.toString() .

    thread "Request for non-throwing cast!" and your reply no. 7 and 9The 'design flaw' reply (no 8) by dcminter holds, but sometimes you have to work with imperfectly designed APIs, and that just have to use multiple if/then/else if ... constructs. This in turn doesn't mean that you have encourage bad design by providing default behaviour. See also reply 21 by lucretius.
    and the track "Possible solution for unchecked casts?"That thread is not about providing new default behaviour, it is about restricting/improving present default behaviour (the unchecked cast)
    But you may answer cast is not an operator.Cast is an operator, but it returns it's argument untouched when it doesn't throw a ClassCastException. This rule allows the compiler to optimize and remove type checks if it can prove that the cast's argument will be of the desired type. In combination with parameterized types, that has proven to be difficult ;)
    I assume you want the Object.as() method because you find yourself writing the same conversion code on different places. In that case, I would advise to create some kind of Converter object that contains the convert() method:
    interface Converter<T,U> {
       /** Convert an object from class T to class U. */
       U convert(T t);
       Class<T> getFromClass();
       Class<U> getToClass();
    abstract class ConversionManager {
       /** get a converter that converts an object to class U. */
       public abstract <T,U> Converter<T, U> getConverter(Class<T> from, Class<U> to);
       /** register a converter that converts an object from class T to U. */
       public abstract <T,U> void registerConverter(Converter<T,U> cnv);
       /** Convert an object to class U. */
       public <T,U> U as(Class<T> tClass, Class<U> uClass, T t) {
          return getConverter(tClass, uClass).convert(t);
    }Because this allows for multiple conversion managers, you can use different conversions on different places.

Maybe you are looking for

  • How to isolate media files in Applications from video uploaders within FMS

    Hello, We have linux-centos with FMS 3.5.2, apache is on another server. We host media files within applications folders. The media files are uploaded via ssh by different users, each one populating her own my_app/streams. the problem: We do not want

  • Username availability in post-login application processes

    Hi there, I have a problem with a post-login application procedure that sets session variables. Some of the variables are based on the username of the user that is logging in. I'm using the function htmldb_custom_auth.get_username to return the usern

  • Digital Handshaking with two PCI-DIO-32HS Cards

    Hardware: two PCI-DIO-32HS Cards Software: LabVIEW 5.1, NI DAQ 6.6 Problem: I'd like to do burst digital handshaking with two PCI-DIO-32HS cards. One being used for sending bit stream while the other receive. Suppose I want to use burst handshake mod

  • Guidance on Aperture and Flickr Integration

    Can anyone point me to anything that advises on the correct way to use the synchronisation feature. I just can't get this to work consistently; my Flickr folder in Aperture does not match the set in Flickr. As seen on Flickr, I routinely get duplicat

  • Sharing configuration files

    Hi, I've a couple of different cache servers offering a mix of services. Some of the services are shared among them and others are not. Is there a mechanism where I can declare those common services a file and import or include them in the respective