Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Age Calculation Summary Trouble

Featured Replies

  • Newbies

Hi, we're trying to use date of birth to pull out demographic reports for clients in certain age ranges (6-9 years old, for example). The age calculation we're using gives us a result that is in decimal format (2.5 years, for 2 years and 6 months, for example).

We then created a calculation field that groups the clients into categories by age using the following calculation:

To calculate if age falls into the 6-9 year old category (Field name=age69):)

If (age calculatednoblanks < "10.0" and age calculatednoblanks ≥ "6.0" ; 1 )

Then we created a summary field that totals that category. To total 6-9 year olds:

Summary Field that totals field “age69”

The problem is that younger ages get summarized in the categories for older ages (for example, 6-9 year olds get counted in the 65 year old category). It’s like FM does not recognize the decimal.

We've tried troubleshooting every way we can think of (mostly by trying to force FM to recognize the decimal) but nothing we have tried has worked. Does anyone have any ideas? I can provide the calculation that we are using to calculate age from date of birth if that is helpful.

We're two FM novices who know just enough to be dangerous, and we don't have a lot of experience with functions or anything like that. So we're hoping to find a simple solution. Any thoughts are much appreciated.

Thanks!

It looks like you have a mixture of number and text type data. First, make sure that the age calculation returns a result of type Number. Then change your formula to:

age calculatednoblanks < 10 and age calculatednoblanks ≥ 6

  • Author
  • Newbies

Thanks. I checked the calculations and both the age calculation and the age group calculation are set to result in a number.

The age calculation that we are using is:

age=(date today - date of birth)/365

Almost all other age calculations we have seen result in # years, months and days. Is there a reason for that? Do you think that the age calculation could be part of our problem?

Thanks again.

No, the reason is that you are using text constants instead of numbers:

6 < "10.0"

returns False, because the comparison is done alphabetically, but:

6 < 10

returns True.

Try calculating years and months and then go from there. Here here is my x'Age calc - a15'D'Birth is the person's birthday and @Today is a field that I fill with current Today date.

Case (

x'Age = ""; "";

x'Age = 0 ; (Month ( a15'D'Birth) - Month (@Today))-1 & "m" & " ( " & GetAsText(a15'D'Birth) & " )" ;

x'Age >0 ; " " & Year ( @Today - a15'D'Birth)-1 & "y " & Month (@Today - a15'D'Birth)-1 & "m" & " ( " & GetAsText(a15'D'Birth) & " )" ;

)

Edited by Guest

You'll need this x'Age calc also

Year ( @Today - a15'D'Birth)-1

NOTE: this calc returns an integer of the persons age from 0-100

So, if today is Feb 10, 2010 and the birthdate is Oct 14, 1943 - the calc returns 66 - which is correct. Now do your calculation

(x'Age >=6 and x'Age <=9) for ages 6-9

etc

Edited by Guest

Year ( @Today - a15'D'Birth)-1

That's not a good way to calculate age - see:

http://fmforums.com/forum/showtopic.php?tid/150087/post/150140/#150140

  • Author
  • Newbies

That makes sense. I came into work this morning to a very excited co-worker who removed the "" and got the correct result.

Thanks!

Now we're working on fixing the age calculation.

Thanks to all for your suggestions.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.