Group Records by Ranges...

Post Author: dkotenoglou
CA Forum: Formula
I use Crystal Reports XI to report on Customer Service Request
sent to the HelpDesk system.
One report I have developed is:
Amount of currently Open Requests followed by Average amount
of Days Open.
I did this by identifying all u201COpenu201D Requests and then do a
count of them.
I then calculate the amount of Days Open for that request
(Current Date u2013 Date Request was Open)
Finally I hide the Details.
So in effect the report looks like
Amount of Open Requests u2013 200
Average amount of Days Open u2013 9
Now I want to further develop this report.  I still want counts and by Days Open, but I
want to group they by static Ranges.
Using the example above I would like it to look like
Amount of Open Request over 30 Days u2013 15
Amount of Open Requests between 5 u2013 30 Days u2013 90
Amount of Open Requests between 1 u2013 5 Days u2013 95
One thought I had wsa to use a Group and a formula for the
group, but I could not access my Date
Range formula in the
Group Window.
I thought about being cheap and running three subreports all
near each other so that it looks like it is one report, but I think that is
silly.  There has to be a better way.

Post Author: dkotenoglou
CA Forum: Formula
I used the wrong option for the Insert Group.  I got it to work.

Similar Messages

  • Dynamically group records by date

    I am attempting to create a report that will dynamically group records into a set number of date buckets.  This is similar to grouping records by a date field and setting the days, weeks, months, etc property but instead of grouping by a set time span I want to a specific number of date groups regardless of date span.  So say i have records where the first date is today at 1am and the last record is today at 9 pm.  I want the data grouped into 10 groups and the time calculated for that group based on total time span / 10.  The first group would be 1AM to 3AM, the second would group 3AM to 5AM, etc..  The reason I am doing this is for a chart that displays record counts over time but the overall timespan will never be known until runtime.  Setting the chart for hourly or weekly doesn't work because if the user runs the report over a year the dates will be illegible.
    Thanks in advance!

    Well this SHOULD be easy. But leave it to CR make not...
    You can start by finding the minimum & maximum dates within your range:
    Local DateTimeVar MinDate;
    MinDate := Minimum({Table.DateField})
    and
    Local DateTimeVar MaxDate;
    MaxDate := Maximum({Person.ModifiedDate})
    Then figure out what the the interval would be if the span is broken down into 10 equal parts"
    DateDiff("n", {@MinDate}, {@MaxDate}) / 10
    From there just use a formula to segregate each records into the appropriate groups:
    EvaluateAfter({@Interval});
    IF {Table.DateField} >= {@MinDate}
        AND {Table.DateField} <= DateAdd("n",{@Interval}, {@MinDate}) THEN 1 ELSE
    IF {Table.DateField} > DateAdd("n",{@Interval}, {@MinDate})
        AND {Table.DateField} <= DateAdd("n",{@Interval} * 2, {@MinDate}) THEN 2 ELSE
    IF {Table.DateField} > DateAdd("n",{@Interval} * 2, {@MinDate})
        AND {Table.DateField} <= DateAdd("n",{@Interval} * 3, {@MinDate}) THEN 3 ELSE
    IF{Table.DateField} > DateAdd("n",{@Interval} * 3, {@MinDate})
        AND{Table.DateField} <= DateAdd("n",{@Interval} * 4, {@MinDate}) THEN 4 ELSE
    IF {Table.DateField} > DateAdd("n",{@Interval} * 4, {@MinDate})
        AND {Table.DateField} <= DateAdd("n",{@Interval} * 5, {@MinDate}) THEN 5 ELSE
    IF {Table.DateField} > DateAdd("n",{@Interval} * 5, {@MinDate})
        AND {Table.DateField} <= DateAdd("n",{@Interval} * 6, {@MinDate}) THEN 6 ELSE
    IF {Table.DateField} > DateAdd("n",{@Interval} * 6, {@MinDate})
        AND {Table.DateField} <= DateAdd("n",{@Interval} * 7, {@MinDate}) THEN 7 ELSE
    IF {Table.DateField} > DateAdd("n",{@Interval} * 7, {@MinDate})
        AND{Table.DateField} <= DateAdd("n",{@Interval} * 8, {@MinDate}) THEN 8 ELSE
    IF {Table.DateField} > DateAdd("n",{@Interval} * 8, {@MinDate})
        AND {Table.DateField} <= DateAdd("n",{@Interval} * 9, {@MinDate}) THEN 9 ELSE
    IF {Table.DateField} > DateAdd("n",{@Interval} * 9, {@MinDate})
        AND {Table.DateField}  <= {@MaxDate} THEN 10
    This is where CR drops the ball... IMHO... it WON'T allow you to to group by a formula field that uses an aggregate in the formula (in this case Minimum & Maximum)... It will however allow to to graph on it, which I assume is what you are actually trying to do.  If anyone knows a way to work around the grouping issue, I'd love to know it myself.
    HTH,
    Jason

  • Grouping of number range for Business Partner

    Hi Team,
    Where do we maintain grouping of number range for Business Partner and assignment of number range to group?
    Thanks,
    Sanjay

    Hi Sanjay
    Go to SPRO > Cross Application Components > SAP bussiness partner > Bussiness Partner > Basic Settings > Number Ranges and Groupings.
    Thanks
    pravin

  • How Journal Import groups records from GL_INTERFACE into Journal Headers

    Hello,
    Does anyone know how or using what criteria the Journal Import program groups records from the GL_INTERFACE into Journal Entries?
    The R12 User Guide says that :
    REFERENCE4 (Journal entry name): Enter a journal entry name for your journal entry.
    Journal Import creates a default journal entry name using the following format:
    (Category Name) (Currency) (Encumbrance Type ID, if applicable) (Currency
    Conversion Rate, if applicable) (Currency Conversion Date, if applicable) (Originating
    Balancing Segment Value), chopped to the first 100 characters. If the above results in
    multiple journals in the same batch with the same name, then additional characters are
    chopped off, and a 2, 3, 4, and so on, is added for the second, third, fourth, journals with
    the same name.
    Does it mean that for every unique combination of Category+Currency+CurrencyConversion Rate+Currency Conversion Date, a Journal Header would be created? I also found that although not mentioned in the user guide, if the Accounting Date within a group of records is different, the import program includes accounting date to the above criteria and tries to create separate Journal headers per Accounting Date.
    Also, is there a way to override this ( Category+Currency+CurrencyConversion Rate+Currency Conversion Date) criteria?
    Thanks,
    Manish

    any suggessions on the above query?
    Thanks & regards
    Aboo

  • Vendor Master Record number ranges

    Hi,
    We have one requirement . At present my client is maintaining the vendor master record number ranges with 4 digits. Ex. 0001 to 9999
    His present requirement is that to maintain the number ranges with 4 digits .ex. 00001 to 99999. They want this should apply even to existing records. Ex: Old number 2345 , they want the present number should be 02345.
    Request you to please help in resolving the issue. Thanks in advance for the help. Matter is urgent
    Thanks
    D.K.Lakshmi narayana

    Hello Lakshmi,
    It seems to me these are your alternatives.
    1) For each old vendor in the 4-digit scheme, create a new vendor master record in the 5-digit scheme with the leading zero. Then, transfer all open documents/master records (invoices, purchase orders, info records, etc.) from the old vendor to the new vendor. Then, block the old vendor.
    2) Same as previous except instead of changing all open documents, only change the master data (e.g., info records or long term contracts or agreements) to the new vendor master record and continue to use the old vendor master record until the open documents are closed. Then, block the old vendor master record.
    I think option 2 will be the "safer" choice. Plus, for reporting, you will probably need to continue using both vendor numbers for a while.
    Maybe someone else has an easier way...
    Cheers,
    Larry

  • Restructure Customer Account Groups and Number Ranges

    We already have existing customer account groups and number ranges and therefore customer accounts.
    We need now to restructure Customer Account Groups incl. number Ranges and Number Range Allocation.
    Is this possible? Any advice?
    Can a customer keep is old customer number and be assigned to the new customer account group, which has a different number range?
    Please adivse.
    Many thanks
    Petra

    Ravi,
    thanks very much for your reply. This information is very useful.
    Just one more question:
    WIth which Customer Number will reallocated customer end up? the originial one or does the customer get a new number relating to the number range of its new customer account group?
    Many thanks,
    Petra

  • Want to get sum/avg first 90% records  in each grouped record set.

    Hi Gurus,
    Need your help or example query which help me to achieve sum/avg first 90% records in each grouped record set. Let me show you the basic query and output and proposed output.
    select Pid, Sum(SalesAmt) TotalSaleAmt, Avg(SalesAmt) AvgSaleAmt, count(*) NoOfSales from ProductSales group by Pid;
    PID TotalSaleAmt AvgSaleAmt NoOfSales
    1 12000 100 120
    2 24000 50 480
    Now I need for PID =1 TotalSaleAmt of first 90% of NoOfSale i.e.120(this is basically nuber of rows found in PrdocutSales Table).
    I hope I am clear enough explain my requirement... I would appreciate if we have some Analytical function available..
    Gurus Pls help me asap..
    Thanks In adavance...
    Srichan.

    Now I need for PID =1 TotalSaleAmt of first 90% of NoOfSale i.e.120(this is basically nuber of rows found in PrdocutSales Table).
    first 90% should mean first 90% by some order, so in this case, which 108 rows (of the 120) do you want to take into consideration?
    with
    the_sample as
    (select 1 the_pid,10 the_sale,1 the_order from dual union all
    select 1 the_pid,20 the_sale,2 the_order from dual union all
    select 1 the_pid,15 the_sale,3 the_order from dual union all
    select 1 the_pid,12 the_sale,4 the_order from dual union all
    select 1 the_pid,12 the_sale,5 the_order from dual union all
    select 1 the_pid,13 the_sale,6 the_order from dual union all
    select 1 the_pid,19 the_sale,7 the_order from dual union all
    select 1 the_pid,11 the_sale,8 the_order from dual union all
    select 1 the_pid,15 the_sale,9 the_order from dual union all
    select 1 the_pid,12 the_sale,10 the_order from dual union all
    select 2 the_pid,25 the_sale,1 the_order from dual union all
    select 2 the_pid,22 the_sale,2 the_order from dual union all
    select 2 the_pid,22 the_sale,3 the_order from dual union all
    select 2 the_pid,23 the_sale,4 the_order from dual union all
    select 2 the_pid,29 the_sale,5 the_order from dual union all
    select 2 the_pid,21 the_sale,6 the_order from dual union all
    select 2 the_pid,25 the_sale,7 the_order from dual union all
    select 2 the_pid,22 the_sale,8 the_order from dual
    select the_pid,the_sum,the_avg
      from (select the_pid,
                   sum(the_sale) over (partition by the_pid order by the_order) the_sum,
                   round(avg(the_sale) over (partition by the_pid order by the_order),2) the_avg,
                   the_order,
                   floor((0.9 * max(the_order) over (partition by the_pid))) to_pick
              from the_sample
    where the_order = to_pickRegards
    Etbin

  • Vendor acct group and number range in the MDC vs MDS

    IN MDM 3.0 when a new BP with vendor as role is created via UI in MDS the vendor is created with a generic BP number range in the MDS.  The down stream MDC's all have different vendor account groups with different number ranges assigned in each MDC..  example...
    client     type of vend   acct grp      num range
    MDC1      purch vendor     com2      1000000-1999999
    MDC1      acct vendor      act1      2000000-2999999
    MDC2      purch vendor     pur1      2400000-2499999
    MDC3      purch vendor     POV1      3599999-3599999
    How does MDS know when it distributes the vendor to the MDC's what account group and number range to create the vendor with in the MDC's.  The MDC cannot change all its existing master data that has been created already with the account groups and number ranges becuase field variants have been established.  Where is this mapping contained MDS or XI and how is it done.

    The number range in the MDS is determined by the value in the "Grouping" combo-box.  This combo-box is populated by values entered in IMG activity Master Data Objects -> Business Partner -> Business Partner -> Basic Settings -> Number Ranges and Groupings -> Define Groupings and Assign Number Ranges.  Each value must have an associated number range and one of the values must be defined as the standard grouping in case the user doesn't select a grouping.  This is how numbering occurs in the MDS.  Unfortunately you cannot assign more that one grouping to a new BP.
    Now, for the MDCs.  When sending a new BP to an MDC, for example an R/3, there must be an external number range setup in the MDS for that MDC and it shouldn't conflict with any number range in that MDC. 
    IMG Activity Master Data Exchange -> Central Settings -> ID Mapping -> Make General Settings for ID Mapping allows you to define which number range you want to use for a specific object type in a specific system (e.g. KNA1 (customer) in system R/3_100). 
    So far this isn't sufficient for you because you have 2 number ranges for MDC1 in your example. 
    In the IMG activity I just mentionned, there is also a possibility to add an additional parameter which allows you to assign a number range for each unique object-type/system/additional parameter combination.  By putting the account group in the additional parameter field, this allows you to assign number ranges per account group.
    What remains to be done is to use this information in the XI Mapping for BP to R/3 Vendor.  The first thing is for the XI Mapping to map the MDS account group to the MDC account group.  Then the XI Mapping must call the MDS to create a new ID-Mapping between the BP and the Vendor.  During this call, the XI Mapping must provide all the usual parameters as well as the account group.  This will ensure that the correct number range will be selected so the correct vendor id will be generated.  This id will then be used in the ID Mapping.
    If you need to create the Vendor for multiple account groups, then you will have to implement special logic to map the MDS account group from the BP to the many MDC account groups needed for the Vendor.
    Hope this helps!

  • Dscl: unable to ad/delete/amend user/group records - eDSPermissionError

    hello,
    i am unable to add/delete/amend opendirectory user and group records. users are still connecting but when i try do any of the above if get the follow error within a dscl session:
    create Users qawsed
    <main> attribute status: eDSPermissionError
    <dscl_cmd> DS Error: -14120 (eDSPermissionError)
    on investigation i noticed the error in system.log indicating that /System/Library/LaunchDaemons/edu.mit.kadmind.plist was missing.
    so my questions are:-
    1 has anyone seen the above error condition when using dscl and
    2 can anyone explain how edu.mit.kadmind.plist is created or post an example of this file
    your assistance is appreciated
    regards
    john

    Post Unix queries to the Unix forum under OS X Technologies and server queries to the server forums.

  • Using property with geocode in record filters/range filters

    Hi All
    We have created a property called "Location" with data type as "Geocode" and we are able to use the same in sorting.And ,this will generate two dynamic properties by name "Kilometers_to_Location and "Miles_to_location".Is there a way to use these dynamic properties in our record filters or range filters?We have requirement to filter products based on say within 100 kms, 1000kms from the user's location and not just sort based on this.
    Any suggestions/help is appreciated.
    Regards
    Shreyas

    Hi Shreyas,
    Does this help:
    http://docs.oracle.com/cd/E37502_01/server.751/es_dev/toc.htm#Geocode%20filters
    Quoting from the link above:
    Geocode filters
    When used with a standard attribute of type geocode, the EQL DISTANCE function indicates a filter based on the distance of that geocode attribute from a given reference point.
    The DISTANCE function returns the distance (in kilometers) between two geocodes. The syntax for DISTANCE is:
    DISTANCE(geoAttribute, TO_GEOCODE(latitude,longtitude))
    where
    geoAttribute
    is a standard attribute of type geocode. The
    TO_GEOCODE
    function creates a geocode from a given latitude and longitude pair, both of which must be of type double:
    The latitude of the location is specified in whole and fractional degrees (positive values indicate north latitude, and negative values indicate south latitude).
    The longitude of the location in whole and fractional degrees (positive values indicate east longitude, and negative values indicate west longitude).
    Note that distance limits in geocode filters are always expressed in kilometers. The records are filtered by the distance from the geocode reference point to the latitude/longitude pair.
    Julia

  • Grouping records in an internal table

    Dear all,
    Pls follow the code and suggest me to get the specified format.
    Consider that  i have created a view to populate the reqd data and collect those in an internal table and do a calculation for one field and modify the internal table.
    when i pass this internal table to the function reuse_alv_grid , it throws out a report. But if i need to group the records of the internal table based on three fields, can i do that , if so , how should i do that, if not what method shud i adopt to get the grouped listing in ALV.
    kindly give your views.
    Code goes here..........
    select distinct edatu j_3akvgr6 mvgr4 matnr bismt vbeln auart bstkd bstkd_e ihrez_e
    bstdk_e bstdk bezei vrvez brgew ntgew volum werks kwmeng j_3asize posnr
    INTO CORRESPONDING FIELDS OF TABLE  itabdelshd
    from ZVDELISHED
    where J_3AKVGR6 IN CUSTOMER AND AUART IN ORDTYP
    AND BISMT IN STYLE  AND MATNR in FGMtrl AND bstdk_e IN PLNDATE
    AND J_3ASIZE IN GRIDVAL and werks in plant and mvgr4 in ppmon and
    bstkd in cpono and vbeln in Sales.
    LOOP AT itabdelshd INTO wadelshd.
          select sum( wmeng ) as tqty into wasumqty-tqty
          from vbep where edatu = wadelshd-edatu and vbeln = wadelshd-vbeln
          and j_3asize = wadelshd-j_3asize.
          select sum( lfimg ) as dqty into wasumqty-dqty
          from lips where vbelv = wadelshd-vbeln and j_3asize = wadelshd-j_3asize
          wadelshd-PLND_QTY = wasumqty-tqty - wasumqty-dqty.
          wadelshd-PLND_QTY = wadelshd-wmeng - wadelshd-lfimg.
          wadelshd-COLOR = wadelshd-j_3asize(4).
          MODIFY itabdelshd  FROM  wadelshd.
    ENDLOOP.
      PERFORM build_fieldcatalog.
      PERFORM build_layout.
      PERFORM display_alv_report.

    Dear Jorge,
    It is working out, But i need to do the sum for the grouped data, for instance , if the below data is grouped data seen in the alv,
    sales ord      | color    line.Item|  Ord.qty   | Pld.Qty     | Date          "
    | 0001000551  | 002V | 100       | 6,800.000 | 1,200.000 | 25.09.2006"
    | 0001000551  | 002V | 100       | 6,800.000 | 2,500.000 | 25.09.2006"
    | 0001000551  | 002V | 100       | 6,800.000 | 3,100.000 | 25.09.2006"
    | 0001000551  | 003K | 200       | 3,200.000 | 700.000    | 25.09.2006"
    | 0001000551  | 003K | 200       | 3,200.000 | 1,200.000 | 25.09.2006"
    | 0001000551  | 003K | 200       | 3,200.000  | 1,300.000 | 25.09.2006"
    and if want to sum the the planed qty based on the line.Item Grouping, meaning, can i get the report in the below form.
    sales ord      | color    line.Item|  Ord.qty   | Pld.Qty     | Date          "
    | 0001000551  | 002V | 100       | 6,800.000 | 6,800.000 | 25.09.2006"
    | 0001000551  | 003K | 200       | 6,800.000 | 3,200.000 | 25.09.2006"
    what should i do to get this form.

  • Max. records in Range table used in Select .. IN  ?

    Hi
    Does somebody knows wich is the max. amount of records in a RANGES table used in Select Comand:
        select xxxx FROM  table
        where  field  IN  range_table.
    That, because i found severeal times programs aborting for this cause, so i changed this condition to an ALL ENTRIES.
    Regards
    Frank

    It really depends on the table and DB settings.
    Check with your DBA folks.
    On our system it's ~ 400-500 for most of the tables.
    NOTE: as it depends on DB settings - it may be different on your development system and on your production system.
    For all entries does ntohave this limitation as it's being split into several selects, you can see it in the trace.

  • Oracle Purchasing: Approvals Group: Item Category Range

    Hi to All,
    I was wondering if anyone has implemented, Item Category Range in the Approvals Group for Purchasing. I have a requirement for a requisitions process that if it has a category code, say X then it will bring up certain people who are attached to this category code. I was trying to see if this could be done thru the approval group in purchasing. I have tested this out where a manager has a dollar amount, account range and item category. But this fails.
    I am trying to avoid doing some customization, within the WF. So if anyone has some ideas how to handle this requirement, please let me know or if you have created the item category code.
    Thanks in advance for any help.

    Hi Mahesh,
    Thank you so much. I have awarded points.
    Jans

  • After transfering the config to QA client.Ex group for No ranges not avail.

    Dear All,
    We have tranfer the configuration to Quality client,On checking the config in QA clinet under maintain excise group --excise group are available but while creating the no ranges In SNRO we are getting the massage Excise GRP -
    Z1 does not Exist.Once again I have created new request for this and transported but still the problem remain the same.Please guide.
    Regards,
    VR

    For maintaining no. ranges for any Excise group which has been configuered & transported, the same excise group has to be maintained in J_1inexcgrp (at the destination client) to enable no. range maintenance for the same at the destination client.
    This activity is in addition to regular config.
    Hope this will help.
    Regards,
    Akhileshwar  K

  • Grouping records based on and ID

    I am trying to build a report that will segment based on a free text field which is used as an identifier between multple records.
    For example I might have three records which each contrain the same id number however the record might have varying values in other fields. I want to build a report that will group all those 3 reports together under the heading of the ID and list the 3 reports. If I have other records that are linked by the ID to other records then I want them to group as well. This can be seen below
    ID 001
    Name     Country     ID
    xyz     USA     001
    ID 002
    abc     Canada     002
    Abc2     USA     002
    ID 003
    Efg1     USA     003
    Efg2     Mexico     
    Thanks

    Hi,
    Try using a pivot table and put the id column under sections. I think that should help.
    All the best.
    Garima

Maybe you are looking for