How to group a report by formula field.

Hi,
I need to create a report based on the following report:
http://s464.photobucket.com/albums/rr8/einas121809/
This new report should be grouped by days and status. Then, each group should display the details of each record such as Report No, Open Date , Due Date and Summary.
It is not a problem to display the report details, but I need to know how to group them since it involve calculation.
Thank you in advance,
Regards,
einas.

Hello,
Right what you want to do is to get a crosstab which can be found in your toolbar or under Insert menu Insert --->Crosstab.
You might need to use a working day formula something like this
WhileReadingRecords;
Local DateVar Start := {StartDate};   // place your Starting Date here
Local DateVar End := {EndDate};  // place your Ending Date here
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<i> ) in 2 to 6 and
     Holidays<i> in start to end then Hol:=Hol+1 );
Weeks + Days - Hol
If you need to calculate bank holidays then you have to create an array like this
//Holiday Listing formula to go into the report header of the report.
BeforeReadingRecords;
DateVar Array Holidays := [
Date (2003,12,25),
Date (2003,12,31)
0
The workingdays formula needs to go into the Row and then distinct Count your orders. That should give you how many orders took x amount of days.
Then you need to further develop your formula so that it shows <20 days, more than 20 days etc.
Create something like this first and then ask further questions if you are stuck.
Hope this helps
Regards
jehanzeb

Similar Messages

  • How to group by more than one fields in crystal reports

    Hi
    How to create groups in crystal reports by more than one fields, like
    select fields,aggregate functions from table group by a,b,c

    Not sure if I understand your question, but you you could create a formula to generate the string of data you want to group on.  Then simply create a group based on the formula field.
    For example, your formula could do something like (assuming all String fields):
    {table1.FirstName} + {table1.LastName} + {table1.DateOfBirth}
    , and then group on this formula.
    -MJ

  • How to intercept variables in report's formula field via TOAD?

    I have a case in this report. I have a report that generates a list of items with info of their initial stock, stock movements and final stock. no problem for the in and out stock movements.
    but there's a slight problem with the initial stock. I wrote a formula field that executes several select queries to obtain the inital stock. The XML report format roughly looks like this:
    Item_Name Initial_Stock Stock_In Stock_Out Final_Stock
    <?Item_name?> <?CF_Init?> <?In?> <?Out?> <?CF_Final?>
    As you can see, the Initial Stock and Final stock data is obtained through a formula field. And the select queries I mentioned above are employed in the formula fields. The rest of the fields are obtained directly from the SQL field in the report. Right now the report generates all items, whether their initial stock is zero or not. What I'm trying to do is not displaying items whose initial stock, stock in, stock out and final stock are zero. thanks
    Edited by: 801264 on Oct 14, 2010 9:22 PM
    Edited by: 801264 on Oct 14, 2010 10:39 PM

    Well you could try upgrading to a more recent Java runtime for starters.
    This is a native crash, which means something went wrong outside of Java code. The trouble is that you can't know WHERE it happens; The JVM itself is only a client of the machine it runs in and can be made unstable by outside influence. Under Linux it takes only one wonky shared library. It could be a driver. It could be a problem in the kernel. It could be another process. It could be anything.
    It could also be a bug in the JVM of course, but the only way you have a right to report it as a bug is if you try to see if the problem persists under the latest update.

  • How to Use conditions in PLD Formula Field

    Dear, Experts
    for eg I have two fields in pld  Field_A and Field_B
    Field A Contains values and fieldB also have values and 0.00 values as well.
    I need to fetch the value to Field C from Field A where Field B >0
    Field_a                                             and field_B                  In third field (Field_C) i need the values of Field_A where Field B>0. 
    1000                                                         567
    2000                                                             0
    500                                                            89
    888                                                           79
    777                                                             0
    700                                                             0
    9000                                                         78
    So here what conditions i should give in the formula filed (Field_C)
    Please help me to solve this issue.
    thanks

    Hi Sudatta,
    Your solution seems to be correct, but I am not getting the point of keeping some of the fields visible.. You can make field Z in your example invisible.
    To make the right formula in PLD you need an extra field, the formula fields in SAP allways give back an 0 or an 1.
    So if you have Field_A and Field_B and Field_C, you also have to create another field (eg Field_D)
    Field D should be typed as a formula field and contain Field_B > 0 or Field_B != 0 or Field_B > 0.00 (just the exact value when you don't want field_C to be filled.
    Field_C should be marked as a formula aswell and contain Round(Field_A,2) in this 2 is the ammount of decimals.
    Then you have to make a connection between field C and D on the general tab (as mentioned before). So Field_C should be connected to field D.
    You can make field_D invisible so it won't be displayed on your lay-out.
    After that it should work.
    Good luck,
    Kind regards,
    Hendri Wessels

  • CUIC Report definition Formula field

    Hello
    I want to get a max value from two different columns in a custom report. Anyone have an idea how to do it. I tried the following but it doesn't work, formula is invalid:
    max(${max_outbound_ipcc_calltime},${max_outbound_nonipcc_calltime})
    max(values(${max_outbound_ipcc_calltime}),(${max_outbound_nonipcc_calltime}))
    Finnur

    You'll have better luck posting this question here:
    http://developer.cisco.com/web/ccr/home
    david

  • Need to Know How to Group Report in 30-Second Time Intervals

    I am trying to group records in the report based on a date/time field in a table.  The user enters a date/time range to report on, and I want the the records from the table that fall within the date/time range entered to be grouped in 30-second intervals on the report.  I've tried a number of different things and can't seem to get anything to work.  Can anyone provide some insight into how this can be done?  Thank you in advance!!

    Hi Joy,
    Sorry for the late reply.
    What you want to do is create a formula something like this (Syntax hasn't been verified... at all)
    whilereadingrecords;
    //I'm assuming your datetime field is a string. It probably isn't but you can do the same op with another
    //data type. I've also assumed (likely wrongfully) that the time in seconds is the last two digits
    //for sake of argument, your date time field has this format: YYYYMMDD-HH:MM:SS
    stringvar strSecondsOfCall;
    stringvar strYourGroupString; //or something
    strSecondsOfCall := right(<yourfield>, 2);
    if(strSecondsOfCall > "30") then strYourGroupString := left( (<yourfield>,15) & "30"
    else strYourGroupString := left( (<yourfield>,15) & "00"
    So, what the formula does is determine if the seconds portion of the date time occured in the former or the ladder half of the minue, and assigns it the floor value (arbitrary implementation on my part, you can call it whatever you like).
    Now, in your report, use the group exppert to group based on this formula field, and you should get the data the come out grouped in 30 second intervals.
    ie: You'll have groups like:
    20081231-12:59:00
       -all of the calls that happened from 59:00 - 59:30
    20081231-12:59:30
       -all of the calls that happened from 59:30 - 00:00
    Happy new year!!!

  • How to group from two fields?

    Afternoon all,
    Any ideas how to group a report by using two fields in one formula?
    I have two fields in a table
    1: Stock_Code
    2: Misc_Code
    I need to group my report by Stock and Misc code combined. How would I be able to do this by using formula?
    Regards
    Jehanzeb

    See I tried that already pandabear however for some reason it doesn't bring the results from both fields. It is only bringing results from one field.
    The report criteria is
    {lab_credits.date_created} in date(2007,01,01) to date(2007,12,31) and
    {lab_reasons.reason_code}={?Reason_Code}
    the formula I used initially was
    {lab_credits2.stock_code}+{lab_credits2.misc_code}
    but then tried
    {lab_credits2.stock_code}+ " " +{lab_credits2.misc_code}
    however both didn't seem to work under the above conditions.
    The output should be
    5-760
    7-240
    7-250
    7-821
    AR
    CARR
    GLAZE
    TINT
    U-113
    U-114
    Where 5-760 and U-113 data is coming from stock_code field and AR to TINT is coming from Misc_code field.
    The output is ignoring the Misc field values under the given criteria.
    Regards
    Jehanzeb

  • 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

  • Grouping a report by a formula field

    Post Author: triley01
    CA Forum: Crystal Reports
    Hello, I am really stuck on this one. I have a report that sums values in Activity.Product_Code field. Based on those values I have created a n IF Else formula that displays a string based on the total. For example, if the sum of Activity.Product_code is less thatn 1000 the string displayed next to the record is 'contributor', if Activity.Product_code greater than 1000 but  less than 2000 the string is 'attache' and so on. Its a report that shows level recognition. The part I can't figure out is how to group by this recogition level and have the report prompt for a level. When I select Insert-Group in Crystal the formula I created is not shown as an available field to group on. Hope this makes sense. Any help would be GREATLY appreciated! thanks in advance. Tim

    Post Author: triley01
    CA Forum: Crystal Reports
    I think I am getting closer. I converted a formula to a CASE statement for an SQL expression (see below). However I am still getting a "Incorrect syntax near the keyword FROM" error when trying to save it in Crystal
    Again any help would be greatly appreciated!
    select ID,
          case
                when sum(amount) > 0 and sum(amount) < 1000 then 'Contributor'
                when sum(amount) >= 1000 and sum(amount) < 2500 then 'Attache'
                when sum(amount) >= 2500 and sum(amount) < 5000 then 'Envoy'
                when sum(amount) >= 5000 and sum(amount) < 10000 then 'Diplomat'
                when sum(amount) >= 10000 and sum(amount) < 25000 then 'Ambassador'
                when sum(amount) >= 25000 then 'Inner Circle'
                else ''
          end as &#91;Description&#93;,
          sum(amount) as &#91;Amount&#93;
    from activity
    where activity_type = 'GIFT'
    group by id

  • 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 apply formula field for a chart object in crystal report XI

    Hi
    how to add formula field for a chartobject, i tried the following code but returns invalid condition field.
    i want to show  different chart in same crystal report viewer with different coursestatus values.
    please suggest where ia m wrong.
                   FormulaField oFormulaField;
                   oFormulaField = new FormulaField();
                   oFormulaField.Name = "Status1";
                   oFormulaField.Text = "{CSP_PROCESS_REPORT.Coursestatus} = 'Mastered'";
                   oFormulaField.Syntax = CrFormulaSyntaxEnum.crFormulaSyntaxCrystal;
                   oFormulaField.Type = CrFieldValueTypeEnum.crFieldValueTypeStringField;
                    boChartObject.ChartDefinition.ConditionFields.Add(oFormulaField);
    regards,
    Padmanaban V

    i missed the following line in my code.
    rcDoc.DataDefController.FormulaFieldController.Add(oFormulaField);
    now it works......
    my next issue is that,
    chart returns True & False captions. but i want to show actual value. how its to be done
    regards,
    Padmanaban V

  • How to set a new value for formula field in crystal reports xi?

    <p>How to set a new value for formula field in crystal reports xi?</p><p>//formula</p><p>{@description}</p><p> </p><p>exemplo in VB6</p><p>crxSubreport.FormulaFields.Item(1).Text =  "&#39;Subreport Formula&#39;"  or</p><p>crxSubreport.FormulaFields.Item("description").Text =  "&#39;Subreport Formula&#39;"</p><p>How to in JRC?</p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p>

    Hi,
    This functionality is known to be very important and is a key part of the next major release of the JRC planned for the first half of 2008.
    Regards,
    <p>Blair Wheadon</p>
    <p>Product Manager, Crystal Reports</p>

  • How to appear a formula field for once at a fom-like report?

    Hi All,
    I have created a formula field and then set the property "Maximum Records per page" to the value 12 for the repeating frame containing this field and all other fields.
    Now I want to make an exception for that formula field
    I want it to be appeared only for one time not 12 times!
    how to do this Plz?

    Hi,
    I assume that your formula column is at a higher level than your repeating frame (in other case it's not clear which value you want to display). Bring the filed representing the formula column behind the repeating frame, then it's diplayed only once.
    Regards
    Rainer

  • How to use the distinct key in formula field in SAP Crystal Reports

    I want to use the distinct key in formula field in SAP Crystal reports.
    When i'm using it shows an error.
    Please suggest me....

    Hi,
    Use DistinctCount keyword directly for your calculation instead of count(distinct(....
    Alternatively, if you want to avoid duplicate records, under "File" > "Report Options" make the 'Select Distinct Records' as True.
    Thanks,
    Raghavendra

  • How can we pass a formula field of Main report to SubRepor's Parameter. in CryastlReport 11

    Post Author: Nikhil
    CA Forum: General
    Hi
    Crystal Report version : 11.0.0.1282 Standard
    There is MainReport1. Other is Subreport1
    Scenario : 
    MainReport1 having paramater PdateMain1 as dateTime.
    SubReport1 having parameter dateSub1 ,dateSub2.
    datesub1 is used for One datasource1 (DataSource- XML -from webApplication)  , dateSub2 is used for datasource2 (DataSource-SQl Procedure ) ( This is requirement as i need to used two datasource )
    Value of datesub1 and datesub1 is same (it is created automatical as it is part of SQLProcedure and XML Query ) but get prompted twice for the same valuewhich  is not desirable. so for that i have created main report and calling this subreport in main report.
    Now i want's to pass PdataMain1 to Parameter datesub1  and datesub2. I am able to pass  PdataMain1 to datesub1.  through Change Sub report link ( Option on right click of report).and it is working fine,
    Problem : 
    But Subreport link Menu does not allow to bind PdateMain1 to datesub2 as it is allready bind with datasub2.
    to overcome this i created one Formula field in main report as fMaindate1 which copy date from Parameter PdateMain1.and bind ( link) the  fMaindate1 to datesub2.  when i link this , subreport does not display any thing at all. It it a limitation of crystal report or i am missing some thing , Is it like that we can pass formula of ,main report to subreport Paramater in Crystal 11 Standard , if we can anyone please Provide help on this.
    This can be easily achieve through application programming but my need to get this done in Report itself.Thanks
    Nikhil Patel

    Post Author: Jagan
    CA Forum: Crystal Reports
    Shared variables. Looked in the help at variables - shared

Maybe you are looking for

  • Lanier Ricoh Printer - still can't get it to work with Snow Leopard

    Does anybody know what this is and how to fix this: Error: /Library/Printer/RICOH/Filters/jobLogFilterC failed I get this in the "open print que" dialog box. JK

  • Maximum Paper Size?

    I have Adobe Acrobat X Std running on Windows 7.  I'm thinking about upgrading to XI.  The key will be paper size.  I create large data models.  Up to 60" X 240".  I know Adobe used to have a 200" limit.  Is it stll the case?   After experimenting wi

  • Can't log in as admin

    I normally have 3 user options upon log in.. ( A, B, C) I log in as the (A) admin. I went for a coffee and closed the macbook while some applications were still open in admin.. When I came back I opened the screen to be confronted with user B's start

  • HELP in API  where sms sending between computer and mobie is the aim

    HI everyone, I'm Ork. I am totally new in this field. So please, help in making the following project I am involved in making a swing API, whose main objective is to :- 1. send sms to mobile phones and back to computers and to and fro, 2. mail anyone

  • Webcam the only thing that shows up in the device selection

    I am trying to use Adobe flash media encoder 3.2 it only shows my webcam under devices that I can select (with two different names). I can't get it to show my computer screen. If someone could give me step by step instructions on how to get my comput