Welcome to Forums Sign in | Join | Help | Forums
in Search


Age Range formula

Last post 09-16-2009 4:30 PM by Patrick Manning. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 09-16-2009 4:11 PM

    Age Range formula

    I'm trying to replicate what Canned Reports Demographic Reports does when it utilizes the Donor Age Range Table defined in Configuration.  However the Donor Age Range table  is not available to Export, so I'm struggling to write a formula for age ranges.  Ideally it'd be, less than 20, 20-39 years old, 40-59; 60+.   Based on a Google search, I tried this:

    Select {CnBio.CnBio_Age}
    Case is < 20 : '0-19'
    Case is > 19, is < 40 : '20-39'
    Case is > 39, is < 60 : '40-59'
    Case is > 59, is < 150 : '60+'
    Case is <= 0 : 'Unknown'

     and the formula checker tells me, "The result of seslection formula must be boolean."

     Then I'm lost!  Anybody know what else I need??

    Filed under:
  • 09-16-2009 4:30 PM In reply to

    • Patrick Manning
    • Top 200 Contributor
    • User Since: 1997
    • Posts 45
    • Organization: College of Charleston
    • Products:  The Raiser's Edge

    Re: Age Range formula

    Assuming the {CnBio.CnBio_Age} comes over as a number field:
     
    If IsNull ({CnBio.CnBio_Age}) then "Unknown" else
    if {CnBio.CnBio_Age}< 20  then "0-19" else
    if {CnBio.CnBio_Age}in 20 to 39 then "20-39" else
    if {CnBio.CnBio_Age}in 40 to 59 then "40-59" else
    if {CnBio.CnBio_Age}>= 60 then "60+" else
    "Unknown"
    Patrick Manning
    Database Administrator
    Advancement Services
    College of Charleston
Page 1 of 1 (2 items)