Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Range Grouping

Status
Not open for further replies.

EMVIC

MIS
Jul 29, 2006
12
GB
Could someone pls assist?
Below is snap shot of my data

EnrolmentDate DOB Age_Range
30/09/1990 12/10/1961
09/02/1991 14/09/1970
18/07/2000 17/02/1972
17/03/1996 19/07/1975

My intended output is to have a column named Age Range which will be grouped based on {EnrolmentDate-DOB}. How can I group the outcome of {EnrolmentDate-DOB} to fall within these ranges:
< 20, 20-24, 25-34, 35-44, 45+. I’m currently using CR9 and DB is SQL server 2000
 
To get the age ranges, first use Ken Hamady's age formula:
You probably want to replace {date.ANN} with the enrollment date to get the age at enrollment.

Then create a formula like:

if {@age} < 20 then "<20" else
if {@age} < 25 then "20 to 24" else
if {@age} < 35 then "25 to 34" // etc.

It is unclear how you want to relate the enrollment dates to the ages. You probably want to insert a group on the enrollment date by some time span, e.g., by year. Then you can insert a group on this age formula to see the distribution of ages by enrollment year. You would insert a count on the birthdate at the age range group level to get a frequency count by age range.

-LB
 
As a point of info, it is not encouraged to post your problem in more than one forum (cross-posting). lbass has taken the time to help with your problem, which has now been wasted since your problem was also answered elsewhere.


Geraint

The lights are on but nobody's home, my elevator doesn't go to the top. I'm not playing with a full deck, I've lost my marbles. Barenaked Ladies - Crazy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top