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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Groupings

Status
Not open for further replies.

Jazztpt

Vendor
Feb 16, 2005
50
I have data which shows a persons age and I want to group the data into to groups i.e. 5-17yrs, 18-59yrs , 60-75yrs
How do I set up the bespoke groups?
Thanks
Jazztpt

 
One way is to create a formula to categorize the ages:

//@AgeGroups
select {table.age}
case is < 5 : "0-5yrs"
case is < 18 : "5-17yrs"
case is < 60 : "18-59yrs"
case is < 76 : "60-75yrs"
default : "76yrs+"

You can then group on this formula.


~Brian
 
Create the following Formula and then group on it.


if {table.field}>4 and {table.field}<18 then '5-17' else
if {table.field}>17 and {table.field}<60 then '18-59' else
if {table.field}>59 and {table.field}<76 then '60-75'
 
Brilliant chaps - thanks for the quick response.
Jazztpt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top