Group Sort Filtering

Hi
I have a report which has a group sort on number of days sickness leave for employees over a period of a year .
Is there a way of setting a condition on the group (sub) total to exclude total sickness less than 8 days and the individual lines that make up the sub total?
Or could you advise of an alternate way to do this.
So to recap I need to exclude employees whose sickness total for a year is less than 8 days.And the report lists individual entries of sickness for a year by employee.
I am using Discoverer Desktop version 4.
Thanks
Edited by: user650649 on 23-Jul-2010 02:28

Hi,
In general, you can do this by using an analytic sum function in a calculation. So you would calculate the total number of days sickness partitioned by the employee and the year. You can then include this calculation in a condition to exclude all the records where this total is less than a given value.
Regards,
Rod

Similar Messages

  • Does the iPod follow the iTunes "sort filters" in Cover Flow?

    Two quick questions:
    1) Is it now generally agreed upon how Cover Flow is sorted on the iPod? (i.e. Is it by +album title+, by artist, or by +album artist+?) Can you change how it's sorted?
    2) If you have used the "sorting" tab feature in iTunes when editing song info, (for example, I have "album artist=Foo Fighters" in song info, but I also have album artist Foo Fighters sorting as "A1 Foo Fighters" for various listing reasons to keep it ahead of other album artists), will the iPod know to follow these sorting decisions?
    The main reason I ask, is that I am digitizing my collection of 400+ cds, 100 of which are classical, 100 are musicals, 100 are rock, and 100 are other genres. I've had a lot of fun in iTunes with the Sorting tab in the song info box, which has allowed me to really sort my albums the way I want. For a classical album, like Bach's St. Matthew Passion, I leave the actual album title "as is," but then I have the Sorting album box sort this as "Classical, Bach's St. Matthew Passion," so that when I sort by album, all my classical cds show up together, in alphabetical order by album title, then my rock cds, etc. I do the same thing for album artist...I'll insert my own prefix, like "A1" or "Classical" or "Musicals" before the album artist name to make sure the genres stay together, even when I sort by album artist.
    I'd like to use the iPod's Cover Flow, so I NEED to know the way the iPod Cover Flow will sort...If it sorts by Album Artist, I'll be much more careful with how I apply Album Artist "sorting" filters to my song info in iTunes. And I need to make REALLY sure that the iPod will actually abide by the iTunes Sorting tab, because otherwise all this tagging work I'm doing is for nothing.

    As far as I can tall the tracks are initially sorted by the *Sort Artist* field. If this field doesn't exist it takes the value of the Artist field, with the provio that a leading "The " is ignored. Once grouped by artist the albums are sorted by the *Sort Album* field. Again, if this field doesn't exist it takes the value of the Album field with a leading "The " ignored. In iTunes artist names begining with numerals are listed first but on the iPod they are listed after those starting with A-Z and before the compilations.
    When displaying the covers the iPod displays a new cover every time the album name and/or album artist changes. If you have one album by a given artist it should show once, even if there are guest artists listed in the artist field. If you have two albums however you may end up with four covers shown. This can be fixed by setting the *Sort Artist* to the main artist for each track with guests.
    When the album is selected every track with the same album name is listed, most obvious if you flip over *Greatest Hits* and find 100+ tracks listed. To fix this you need to give every album a unique name. e.g. append ", Artist" to affected album titles. You can do this invisibly by making this change to the *Sort Album* field but it's worth noting this bug exists in iTunes too and it's probably better done visibly when using other views. The *Sort Album* field comes into it's own however when you want a group of albums displayed in a specific, non-alphabetical order. I have the Hitchhikers Guide radio series which I have reoganised to appear as single albums and set the fields as *Hitchhikers Guide 1*, *Hitchikers Guide 2* etc. to list them in the right order while still displaying the full album title.
    Lastly the albums are displayed with the Artist field of the first track rather than the album artist. Looks odd on compilations and where the first track has a guest artist. No fix or workaround that I know of...
    It took a while, but every one of my albums is listed in Cover Flow exactly once.
    tt2

  • How to do sorting/filtering on custom java data source implementation

    Hi,
    I have an entity driven view object whose data should be retrieved and populated using custom java data source implementation. I've done the same as said in document. I understand that Query mode should be the default one (i.e. database tables) and createRowFromResultSet will be called as many times as it needs based on the no. of data retrieved from service, provided we should write the logic for hasNextForCollection(). Implementation sample code is given below.
    protected void executeQueryForCollection(Object qc, Object[] params, int noUserParams) {      
    Iterator datumItr = retrieveDataFromService(qc, params);
    setUserDataForCollection(qc, datumItr);
    hasNextForCollection(qc);
    super.executeQueryForCollection(qc, params, noUserParams);
    protected boolean hasNextForCollection(Object qc) {
    Iterator datumItr = (Iterator) getUserDataForCollection(qc);
    if (datumItr != null && datumItr.hasNext()){
    return true;
    setCallService(false);
    setFetchCompleteForCollection(qc, true);
    return false;
    protected ViewRowImpl createRowFromResultSet(Object qc, ResultSet resultSet) {
    Iterator datumItr = (Iterator) getUserDataForCollection(qc);
    Object datumObj = datumItr.next();
    ViewRowImpl r = createNewRowForCollection(qc);
    return r;
    Everything is working fine include table sorting/filtering. Then i noticed that everytime when user perform sorting/filtering, executeQueryForCollection is called, which in turn calls my service. It is a performance issue. I want to avoid. So i did some modification in the implementation in such a way that, service call will happen only if the callService flag is set to true, followed by executeQuery(). Code is given below.
    private boolean callService = false;
    public void setCallService(boolean callService){
    this.callService = callService;
    public boolean isCallService(){
    return callService;
    protected void executeQueryForCollection(Object qc, Object[] params, int noUserParams){
    if (callService)
    Iterator datumItr = retrieveDataFromService(qc, params);
    setUserDataForCollection(qc, datumItr);
    hasNextForCollection(qc);
    super.executeQueryForCollection(qc, params, noUserParams);
    Issue i have:
    When user attempts to use table sort/filter, since i skipped the service call and set null as userDataCollection, createRowFromResultSet is not called and data which i retrieved and populated to view object is totally got vanished!!. I've already retrived data and created row from result set. Why it should get vanished? Don't know why.
    Tried solution:
    I came to know that query mode should be set to Scan_Entity_Cache for filtering and Scan_View_Rows for sorting. I din't disturb the implementation (i.e. skipping service call) but overrided the executeQuery and did like the following code.
    @Override
    public void executeQuery(){
    setQueryMode(callService ? ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES : ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS);
    super.executeQuery();
    By doing this, i could able to do table filtering but when i try to use table sorting or programmatic sorting, sorting is not at all applied.
    I changed the code like beolw*
    @Override
    public void executeQuery(){
    setQueryMode(callService ? ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES : ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
    super.executeQuery();
    Now sorting is working fine but filtering is not working in an expected way because Scan_View_rows will do further filtering of view rows.
    Question:
    I don't know how to achieve both filtering and sorting as well as skipping of service call too.
    Can anyone help on this?? Thanks in advance.
    Raguraman

    Hi,
    I have an entity driven view object whose data should be retrieved and populated using custom java data source implementation. I've done the same as said in document. I understand that Query mode should be the default one (i.e. database tables) and createRowFromResultSet will be called as many times as it needs based on the no. of data retrieved from service, provided we should write the logic for hasNextForCollection(). Implementation sample code is given below.
    protected void executeQueryForCollection(Object qc, Object[] params, int noUserParams) {
      Iterator datumItr = retrieveDataFromService(qc, params);
      setUserDataForCollection(qc, datumItr);
      hasNextForCollection(qc);
      super.executeQueryForCollection(qc, params, noUserParams);
    protected boolean hasNextForCollection(Object qc) {
      Iterator datumItr = (Iterator) getUserDataForCollection(qc);
      if (datumItr != null && datumItr.hasNext()){
        return true;
      setFetchCompleteForCollection(qc, true);
      return false;
    protected ViewRowImpl createRowFromResultSet(Object qc, ResultSet resultSet) {
      Iterator datumItr = (Iterator) getUserDataForCollection(qc);
      Object datumObj = datumItr.next();
      ViewRowImpl r = createNewRowForCollection(qc);
      return r;
    }Everything is working fine include table sorting/filtering. Then i noticed that everytime when user perform sorting/filtering, executeQueryForCollection is called, which in turn calls my service. It is a performance issue. I want to avoid. So i did some modification in the implementation in such a way that, service call will happen only if the callService flag is set to true, followed by executeQuery(). Code is given below.
    private boolean callService = false;
    public void setCallService(boolean callService){
      this.callService = callService;
    public boolean isCallService(){
      return callService;
    protected void executeQueryForCollection(Object qc, Object[] params, int noUserParams){
      if (callService) {
        Iterator datumItr = retrieveDataFromService(qc, params);
        setUserDataForCollection(qc, datumItr);
      hasNextForCollection(qc);
      super.executeQueryForCollection(qc, params, noUserParams);
    }Issue i have:
    When user attempts to use table sort/filter, since i skipped the service call and storing of userDataCollection, createRowFromResultSet is not called and data which i retrieved and populated to view object is totally got vanished!!. I've already retrived data and created row from result set. Why it should get vanished? Don't know why.
    Tried solution:
    I came to know that query mode should be set to Scan_Entity_Cache for filtering and Scan_View_Rows for sorting. I din't disturb the implementation (i.e. skipping service call) but overrided the executeQuery and did like the following code.
    @Override
    public void executeQuery(){
      setQueryMode(callService ? ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES : ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS);
      super.executeQuery();
    }By doing this, i could able to do table filtering but when i try to use table sorting or programmatic sorting, sorting is not at all getting applied.
    I changed the code like below one (i.e. changed to ViewObject.QUERY_MODE_SCAN_VIEW_ROWS instead of ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS)
    @Override
    public void executeQuery(){
      setQueryMode(callService ? ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES : ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
      super.executeQuery();
    }Now sorting is working fine but filtering is not working in an expected way because Scan_View_rows will do further filtering of view rows.
    If i OR'ed the Query Mode as given below, i am getting duplicate rows. (vewObject.QUERY_MODE_SCAN_ENTITY_ROWS | ViewObject.QUERY_MODE_SCAN_VIEW_ROWS) Question:
    I don't know how to achieve both filtering and sorting as well as skipping of service call too.
    Can anyone help on this?? Thanks in advance.
    Raguraman
    Edited by: Raguraman on Apr 12, 2011 6:53 AM

  • How do I change the number in a Top N Group Sort

    I have a report that I have grouped on a particular field (Cust.Name specifically). I then used the group sort expert and selected the Top N selection in the combo box under the Cust.Name tab. I put in a default number of 20. What I want to do is to set this number for the Top N group sort via .NET. Does anyone know the correct method for doing this in either VB.NET or C#.NET. I am using VS 2005 Pro and the embedded Crystal Reports engine for VS.NET. Thank you.
    Ed Cohen

    Hello, Edgar;
    In the bundled version of Crystal Reports 10.2 in Visual Studio .NET 2005 you will need to use the following code:
    Private Sub Set_TopN()
            Dim TopNSortField As TopBottomNSortField
            'Get the Sort field by index
            'Cast it as a TopBottomNSortField
            If TypeOf crReportDocument.DataDefinition.SortFields.Item(0) Is TopBottomNSortField Then
                TopNSortField = crReportDocument.DataDefinition.SortFields.Item(0)
                TopNSortField.NumberOfTopOrBottomNGroups = 10
            Else
                TopNSortField = Nothing
            End If
        End Sub
    In a full version of Crystal Reports there is an option to create a parameter as a number such as {?TopN} and then pass the value to it at runtime.
    In the Crystal Reports designer you need to create the parameter and then go to Report|Group Sort Expert.
    Choose TopN based on your field.
    Where N is... You will need a number there. I used 1. But then I clicked on the Formula editor [X+2] and added the parameter field {?TopN}.
    Passing the parameter at runtime ran the number I requested.
    Elaine
    Edited by: Elaine Dove on Mar 3, 2009 12:12 PM

  • Sum of a sum when using Top N in the Group Sort Expert

    Hi All,
    I have a small problem I can't quite seem to work out.
    I have a report where each line is for a particular Product, and is a summation of the Sales for that Product over several Locations. When you click on the line, it shows the breakdown of Sales over each Location.
    I use the Group Sort Expert to display the Top N results, where the 'N" is set in a formula to a parameter passed in to the report, so the user can select the top 5,10,50 etc. Products across all Locations.
    At the bottom of the report, I want to have a sum of a column of Sales $. I need that sum to only be a sum of the Top N records selected.
    Since each line is a summation of the all the products for the Locations, what I need is a sum of that sum for the Top N, but Crystal will not let you add the sum of a sum, so I'm not sure how to accomplish this.
    If I just do a sum of the underlying values I get a total for all the Products, regardless of the Top N.
    Hope that makes some sense !
    Many Thanks
    Paul

    Hi Sastry,
    I tried your suggestion, thanks, but I don't think it's the answer. For a start Crystal will not let me do that, it pops up a message box when I try to run the report "A running total cannot refer to a print time formula. Details: Record Number". I also added the record number field next to the lines in the report to see what the result would be, and I don't think it would work anyway.
    Here is an example using Units sold:
    Product Name--LocationUnits Sold--Record Number
    Product A -<All Stores>----8
    Store A--1--
    1
    Store B--3--
    2
    Store C--4--
    3
    Product B--<All Stores>--3      
    Store A--2--
    4
    Store B--1--
    5
    Product C--<All Stores>--
    1
    Store A--1--
    6
    Note that only the bold lines are shown in the report,. If you click on the bold line, then the breakdown of the stores is shown. For the above example, I am showing the Top 2 units across all stores (so Product C is not shown at all), but there are actually 5 records, so if I used a formula where RecordNumber <=N, where in this case N=2, I would get a total units sold of 1 + 3 (records 1 and 2) which is incorrect.
    I will have more of a think on this and see if I can find a solution, in the mean time, any other suggestions ? Is there some wya of checking if the line is visible maybe ?
    Thanks for your time !
    Paul

  • Grouping of Filters

    Hello All,
    We have a requirement to group of multiple filters should be applied in report. For instance we have a report with one customer and Amount Sales, Net Sales, Target, Sales;
    Our requirement is if all the measure columns are zero or null then the row should be filtered out. But when any one of the measures is having value and others are null the row should appear. Means we need to group filters for three measures where the measures are o or null,  when this condition satisfies only then the row need to be filtered.
    Example:
    Customer   Amount Sales  Net Sales    Target Sales
       x                         10                       20               30
       y                         12                        0         
       z                          0                         0                 0
       k                          0                                            0
    In the above records I need to filter out 3rd and 4th rows which contains all zero or null. But second row should not be filtered out.
    I have tried grouping of filters but it's filtering out the rows with any of the measue having zero, i.e, in above example it;s filtering out second row also. That should happen.
    Help/Suggestion would be highly appreciable. Thanks

    Hi,
    Try to create a filter with one column and then check the option convert this filter to SQL and click OK. Then you can input your SQL code to do what you want.
    Hope that help!

  • 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.

  • Providing sorting filters for a table in webdynpro java application

    ho to provide sorting  , filters , for a table in webdynpro java application .

    Hi Pradeep,
    Please go through the following article on implementation of filtering and sorting:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f024364b-3086-2b10-b2be-c0ed7d33fe65
    The article contains a link to a sample application using the TableSorter and TableFilter Class.
    The same classes can be used by any other web dynpro application. Download the sample application and copy the classes. In case of a specific requirement, modify the TableSorter and TableFilter classes.
    Regards,
    Kartikaye

  • Sorting & Filtering in the same table

    Hello,
    i had table with 5 entries in it.
    First Column  -     a, ba, ab, aa, bb
    Second Column - 4, 2, 1, 3, 5
    I had sucessfully implemented Sorting & Filtering functionality to that table.
    single Action:
    1) when I sort 'First' column, as expected it is sorting that column - display 5 rows
    2) when I filter 'First' column with value 'a', as expected it is filtering that column - display 4 rows (as 'a' is in 4 entries)
    Double Action:
    1) when I Filter 'First' column with value 'a', result displayed is 4 rows, then on that 4 entries when sorted the second column -- reuslt is good 4 entries (ie the sorting is done on the filtered entries)
    2)Vice vesa, when i sort 'Second' column & Filtered the first column - the displayed result is not correct
    First Option: (2 actions one after another) when sort second colum and then filtered the First column - result should be the sorted & filtered values of second column ignoring the first.(ie result should be -- a, aa, ab, ba, but filtering result is not sorted). How can i achive this?
    if first option is not possible then second option
    Second option: when i sort the second column & filter the first column,  then the result should be -- Filted the first column & sort the second column and then the result should display (it should be like sorting is done on the filtered values).
    Conclusion: If I filter a column, then filtered entries displayed should be in a sorting order (may be ascending).
    Thanks
    Maha
    Edited by: Maha Hussain on Aug 6, 2009 12:02 PM
    Edited by: Maha Hussain on Aug 6, 2009 12:18 PM
    Edited by: Maha Hussain on Aug 6, 2009 12:25 PM
    Edited by: Maha Hussain on Aug 6, 2009 12:56 PM

    Hi Maha,
    Please go through this pdf you will get the solution definitely,
    https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/f024364b-3086-2b10-b2be-c0ed7d33fe65
    thanks,
    viswa

  • Group/Sort Summary Totals for Duration % Complete not working

    Hello, I'm new to this forum and have used p3 off and on years ago and had some exposure to p5, my background is more toward Project Controls - Cost management rather than scheduling. Here is my issue/question: I was told by the PM not to baseline the schedule (I know, I should have but I didn't, I did as I was specifically requested), that is a topic for another day, however. I am trying to understand the process of the % completes on my resource loaded schedule which all activities are set to duration percent complete. The schedule has roughly quarter of the activities which have been actualized, but my issue is with the "Summary Totals" of the duration % complete when I select that option in the Group/Sorting. All of the activities in a group for example will show 0% complete but the Summary Total of those activities will show greater than 0% or some of the activities duration % completes show a value greater than 0% but the Summary Total of those activities show 0%. What is causing this and why are they not consistent? Any help is greatly appreciated!
    Shannon

    I'm currently showing the duration % complete with a renamed label. The total is not rolling up to the summary. I've also discovered that the unit % complete is not calculating correctly too I believe. For example: I have 3708 budgeted hours and have expended 656 hours and the Unit % Complete is showing 19.08% when I would have thought that the % would have been calculated based on Actual Units (656) / Budgeted Units (3708) totaling 17.69% not 19.08% which it is showing. I cannot find in the reference manual how the percent completes are calculated for units nor in the help section of the software itself either. An explenation would be greatly appreciated!
    Shannon

  • Use parameter to specify "N" in Top N Group Sort

    I've successfuly set up a parameter which is passed to the Group N Sort criteria.
    Is there a way I can use this to set NO group sort? I've tried setting it to zero & 999999999 but it falls over.

    I think you can enter the values only between 1 to 32767. You can try creating a sample report with groups in it and go to group sort expert and select top N and try to add the value 0 then you will get a popup saying "Please enter an integer between 1 and 32767"
    Regards,
    Raghavendra

  • GROUP SORT PARAMETER

    I have a report with a group sort of the "Top N" items based on profit.  I already have a parameter that allows the user to specify the "N", but I want to also give the option to change the group sort based on sales or units sold.  Is there a way to do that?

    hello all,
    actually Brian's solution is correct...i use this method all the time.
    add two more steps to his solution...you should have created a formula with syntax
    Select {?GroupField}
       Case "Sales" :{table.SALES}
       Case "Units Sold" :{table.UNITS_SOLD}
       Default :{table.SALES};
    1) now add this formula to the details section, right click on it, and add a Summary, type = Sum.
    2) now go to the Group Sort Expert and add the formula, removing any other sorts in there already.
    you can now sort the groups on this formula that he gave you.
    if you have crystal reports 2008 or 2011 you can also use Interactive Sorts instead of using a parameter / prompt.
    cheers,
    jamie

  • Group sort using 2 fields

    Is there any way that I can have two fields as a group sort in order that the first group sort field will repeat when the second field changes?
    Thanks.
    Leah

    One possibility would be to create a calculated item (ItemA||ItemB), and use that as a hidden group sort. Not sure about your platform, but in Desktop, you need to specify the item as a 'group' sort, then change it to 'hidden'. You would still display your original items, but don't sort on them.

  • Group Sort Option

    I have a formula on a group level.  That is in basic sum(x)-sum(y)/sum(y).
    I need to use this as a group sort option and it does not seem to allow me to

    Hi Brian,
    In order to sort with the result of sum(x)-sum(y)/sum(y) use the group sort order based on sum(x). Since we cannot sort on the result of the formula that contains summaries.
    Thanks & Regards,
    Raghavendra.G

  • Group Sort Expert Top N

    In Group Sort Expert I have a group called @Sku and I want to select the top 500 based on Sum of @SortByData which works except the totals are for the whole group and not just the top 500.
    Also I would like to select Ascending/Descending based on a parameter field IN the Group Sort Expert since I'm using a based on field (not in Group Expert Change Group Options).

    Hi sharonamtowler,
    My requiremnet is TOP N Materials based on the Current Availiable Stock in each Plant.  In CR from my db, I get four records in Details section for each Material (on 4 weeks, let say 48,49,50,51 ) of a Plant.
    I have grouped on Plant & material. 
    But to get Top N Materials I have to do Summation(Current Availiable Stk) which mean in My Material Group Section I get the Sum of Current availibale Stock of 4 weeks. But I need Top N based on the last weeks Current Availible Stock.
    How to do this?
    I left Plant in Group Sort Expert with No Sort and on Material I have given TOP N.
    I need to know whether only Summation Values should be used in Group sort expert ?
    please some help me solvethe issue.
    Edited by: KRISHNA CHAITANYA B on Dec 29, 2009 6:12 AM

Maybe you are looking for

  • What would happen if I restore an iPhone with a previous backup on your PC?

    I Need help guys ! I don't want I really did something good or bad like did I just delete everything on the phone before the backup !? PLease help

  • Upgrade my Safari

    How do I quickly, easily and safely upgrade my Safari? I currently have version 1.3.2 and it is giving me problems. Thank you for your help!

  • Hyperlinks to files iWeb 09

    I am trying to set up hyperlinks to pdf files on my computer using iWeb09. When I select the text for the hyperlink and go to the inspector and link to the file "application.pdf" the text on the web page changes to the file name. Is that what is supp

  • Selection Criteria for Quick View

    Hello all, does anybody have an idea how to add an additional filed to selection in Quick View? I need to add Purchasing group. Thanks for any ideas. Regards, Igor

  • BW project Architecture

    Hi Can anybody explain about 1) what is the BW project Architecture? 2) What is the project landscape? please forward documentation on these topics [email protected] thanks in advance dj