Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
rittermd
Master
Master

Create groups based on calculation

I have a field for Date of Birth.  I want to calculate their age and show a chart which displays the number of members in each age group.

Age groups would be like 30-39, 40-49, etc.

I can calculate the age.  But no idea how to group them and build the chart.

12 Replies
swuehl
MVP
MVP

Ok, you are using an SQL function, here. We were talking about the QV function.

You can use the QV functions in a preceding load:

LOAD *,

          class(Age_Int, 5) as Age_Class;

LOAD *,

          age(today(1),birth_date) as Age_Int;

Select

member_id,

first_name,

last_name,

member_type,

city,

zipcode,

phone,

email,

birth_date,

age (birth_date) AS Age_Bracket,

gender,

sign_up_date,

county,

firm_id,

state

from members

Where Not (Member_type = 'M');   

rittermd
Master
Master
Author

Thank you.  That worked.

rittermd
Master
Master
Author

Sorry for all the questions.

1.  How do I sort the axis so that I have 10-20 then 20-30 then 40-50, etc.

2.  How can I change the values on the axis to look like the above?