?
Solved

Group by 7 day increments

Posted on 2012-03-27
3
Medium Priority
?
520 Views
Last Modified: 2012-08-13
GroupExample.xlsRather than grouping by a week, I need to create groups of 7-day increments.  I have a list of patients that sums the amount of treatment time received per day.  Then, I need to group these in 7-day increments (and look for how many times they met the 180 minute goal in that period).  

The starting date of the treatments is different for each patient, as is the ending date.  I have attached an example which demonstrates how I have it now (grouped by week), and how it should look (grouped by 7-day increments).  I am new to Crystal, but it seems to me that you should be able to change grouping increment, I just cannot figure out how.  

Thanks for your help.
0
Comment
Question by:dizma
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 37774716
You can't really change the grouping increment however, you could change the treatment dates so the dates always start on a Monday.

You could also do this with manual grouping fairly easily

Do you have other data available to the report?

mlmcc
0
 
LVL 77

Accepted Solution

by:
peter57r earned 2000 total points
ID: 37775905
You can't change the built-in meanings but if you include a simple sql query in your data source then it should be possible to do what you want.

Assuming your current source is a table, then you need to go back into the database expert and  use the AddCommand option to include a query that gets the minimum date for each patient.

The query must be written in the sql dialect of your database but will be something like...

Select PatientID, min(yourdatefieldname) as MinDate from yourtablename Group By PatientId

You can then join this to your current table on PatientID fields, which in effect attaches the patient's min date value to every record.
This allows you to create a formula field in the report, to give the week number,  which would be..

({table.yourdatefieldname} - {command.MinDate}) \7 +1      //note \ not /

You can then group on this field (within your patient group, of course).
0
 

Author Closing Comment

by:dizma
ID: 37778401
Thank you so much.  Very clean approach and well described!
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question