Software Venture Consulting

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
Training
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages
Videos
Adventures
Links

Shopping Cart
Shopping Cart

Search:

Free Newsletter
Signup


Contact


Privacy Policy



FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.

 

 FileMaker Pro Custom Functions

List  |  Show Random  |  Upload  |  Add This to Your Site

get_Generation

Rate this function:  

RatingRatingRatingRatingRating
  Average rating: 4.2  (27 votes)
  Discuss this Custom Function

John Pollard, generic human studies
http://generichumanstudies.com

Find Generation

Sample Input:
a birthday
Sample Output:
Baby Boomer


 Then copy & paste into FileMaker Advanced's Edit Custom Function window.

Click here to copy To Clip Manager if you have myFMbutler's Clip Manager installed

Description:

Just a calc to determine what "generation" a person was born according to the marketing mode people. I hope it's right.

Given a nice tight edit by vr, who clarified some issues about it. I suppose I should fix the astrological one as well.



;-)

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

This is my Custom Function and I want to edit it

Discuss:

The Case() function returns the result of the FIRST test that returns true - so you could shorten the whole thing to just:

Let (
y = Year ( birthday )
;
Case (
y < 1900 ; "Too old" ;
y ≤ 1945 ; "Silent Majority" ;
y ≤ 1954 ; "Baby Boomer" ;
y ≤ 1965 ; "Gen Jones" ;
y ≤ 1976 ; "Gen X, Lost" ;
y ≤ 1994 ; "Gen, Y, Millennial" ;
y ≤ 2006 ; "Gen Z" ;
"Too young"
)
)


Note:

1. Year (date) returns a number; to compare it with another year (also a number) you should not quote that number - otherwise the comparison will be alphabetical instead of numeric. Not critical when all numbers are four digits long, but still good practice.

2. The parentheses around the comparison are redundant;

3. You can save the repeated evaluation of Year ( birthday ) by storing it in a variable.

comment, VR
March 22, 2015 3:51pm

Hey VR,

I appreciate this. Could you work this magic on the astrological calc? So that's updated as well.

There's a year and month date, so i'm not sure what the approach would be there, but this sure is a cleaner version.

Many thanks,

JP

John, Sacramento
March 22, 2015 5:29pm

Old way it was, just for reference how not to do it.

Case( (Month(c0_person_birthday) = 3 and Day(c0_person_birthday) >= 21) or (Month(c0_person_birthday) = 4 and Day(c0_person_birthday) <= 19); "Aries";
(Month(c0_person_birthday) = 4 and Day(c0_person_birthday) >= 20) or (Month(c0_person_birthday) = 5 and Day(c0_person_birthday) <= 20); "Taurus";
(Month(c0_person_birthday) = 5 and Day(c0_person_birthday) >= 21) or (Month(c0_person_birthday) = 6 and Day(c0_person_birthday) <= 20); "Gemini";
(Month(c0_person_birthday) = 6 and Day(c0_person_birthday) >= 21) or (Month(c0_person_birthday) = 7 and Day(c0_person_birthday) <= 22); "Cancer";
(Month(c0_person_birthday) = 7 and Day(c0_person_birthday) >= 23) or (Month(c0_person_birthday) = 8 and Day(c0_person_birthday) <= 22); "Leo";
(Month(c0_person_birthday) = 8 and Day(c0_person_birthday) >= 23) or (Month(c0_person_birthday) = 9 and Day(c0_person_birthday) <= 22); "Virgo";
(Month(c0_person_birthday) = 9 and Day(c0_person_birthday) >= 23) or (Month(c0_person_birthday) = 10 and Day(c0_person_birthday) <= 22); "Libra";
(Month(c0_person_birthday) = 10 and Day(c0_person_birthday) >= 23) or (Month(c0_person_birthday) = 11 and Day(c0_person_birthday) <= 21); "Scorpio";
(Month(c0_person_birthday) = 11 and Day(c0_person_birthday) >= 22) or (Month(c0_person_birthday) = 12 and Day(c0_person_birthday) <= 21); "Sagittarius";
(Month(c0_person_birthday) = 12 and Day(c0_person_birthday) >= 22) or (Month(c0_person_birthday) = 1 and Day(c0_person_bi

John, Sacramento
March 22, 2015 5:57pm

use DayOfYear() and 1 somewhere for leap year.

unix, Japan
March 22, 2015 7:54pm

@John:
Join a forum, e.g. http://fmforums.com

comment, VR
March 24, 2015 10:42am

Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:

Your Name:
City/Location:
Comment:
characters left. If you paste in more than 1500 characters, it will be truncated. Discuss the function - advertisements and other useless posts will be deleted.
Answer 6 + 3 =
Search for Custom Functions:

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. decFromHex ( hexValue )
  (Mon, Oct 16, 12:34pm)
2. MonthYearList ( startmonth ; startyear ; numbermonth ; short )
  (Mon, Oct 16, 3:38am)
3. ErrorDescription ( errorNumber )
  (Wed, Sep 27, 2:51am)
4. decodeEntities (text)
  (Wed, Sep 27, 1:22am)
5. HexidecimalToNumber ( HexidecimalValue ; counter )
  (Mon, Sep 25, 12:39pm)
6. FixedFieldConverter ( Fieldname ; f1 ; f2 ; f3 ; f4 ; f5 ; f6 ; f7 ; f8 ; f9 ; f10 ; f11 ; f12 ; f13 ; f14 ; f15 ; f16 ; f17 ; f18 ; f1
  (Fri, Sep 15, 12:34pm)
7. ShannonEntropy ( text )
  (Thu, Sep 07, 5:59am)
8. LetterCount ( text ; summary )
  (Thu, Sep 07, 5:53am)

RSS Feed of Custom Functions