Wim Gielis wrote: ↑Tue Jun 09, 2020 11:58 pm
tomok wrote: ↑Tue Jun 09, 2020 11:52 pmYes, of course but I was going on the assumption that the OP wanted age in years, not fractional years. Using 365 would be accurate except for 1 day every four years.
When doing a DOB calculation, why would one ever want to use fractional years ?
Put differently, I was born January 19,1981. So I turned 39 on January
10, 2020, or on January
19, 2020 ?
I'd be quiet about that if I were you; you could be skewering your chances to get in as FC Lucyvo's next striker. There may still be hope for you as a no nonsense centre back, though. The oldest, er, I mean, most mature Italian player I know of (in Serie B if I recall correctly) was a 45 year old GK who the rest of the team called "Nonno" (grandpa). Yes, 45. That's depressing.
Wim Gielis wrote: ↑Tue Jun 09, 2020 11:58 pm
Who would like to have such an inaccurate answer ?
Agreed. It can also have other effects as well though admittedly they're edge cases. For example some government benefits, tax concessions, etc kick in at an exact number of years, which can have an impact on calculations within a payroll budgeting model. To give a random example in Australia if you are over... 50, I think it is? (I don't have the model up at the moment) you need to get an extra week's pay if you are made redundant. In cases like that calculating age is such a pain in the backside because of leap years (and the omission of leap years in some centuries) that I don't even bother doing it. I'd rather take the day, month and year components from the birth date, whack {50} (or whatever; because the law can change I have this sort of thing as a value in a system cube) onto the year, then just work out whether the resulting serial date is < the current one. This calculation is kept in a cube which contains employee master data, just as a 1 if the rule applies, 0 if not.
Realistically or at least theoretically, in Australia at least, that kind of calculation should be the ONLY reason for working out an age. Under the anti-discrimination law asking a person's age in an interview is off limits, and discriminating against someone on the basis of age is also off limits... up to a point. To use the example above you would be hard pressed to say that a person's age is immaterial to the coach / manager of a calcio team. "You're 49, and you want to be my new box to box midfielder? Yyyyeah, I gotta tell you, nonno, I foresee some complications here." However that aside, in a normal industrial or commercial firm the question would need to be asked about why a manager would need to know the ages of his employees if not for the purpose of culling. Which is, of course, illegal. Here, anyway. In theory, anyway.
Of course anyone is free to ask me my age. If I'm in a good mood I'll say "over 21". If not, it's more likely to be "**** off and mind your own gorram business, and yes, Ferrari SHOULD have picked me over Sainz".
Interestingly Excel has the same basic problem. I don't know which genius at Microsoft wrote
this document, but:
Some Microsoft 'Droid Who Can't Count wrote:Excel can help you calculate the age of a person in different ways. The table below shows common methods to do so, using the Date and time functions.
=(YEAR(NOW())-YEAR(A2))
The result is the age of person—the difference between today and the birthdate in A2.
In the immortal words of my poker buddy Brock Samson,
"ARE YOU FREAKIN' KIDDING ME??" For someone whose birthdate is 31 December, that will give the wrong answer for 364 out of 365 days most years, and 365 out of 366 the other ones. If the person has yet to have their birthday in the current year, it will again be wrong. The solution in Excel is of course the DateDif function, which you WON'T find in the formula wizard because according to Microsoft it's there for Lotus compatibility only, and may return the wrong value in some cases (though not, as far as I'm aware, for age calculations). So rather than, oh, I dunno, FIXING the function so that it DOESN'T ever return an error, or alternatively creating an explicit Age() function, MS finds it easier to just pretend it isn't there.
Though that does raise the question of whether an Age() TI/Rules function might be a useful target for an RFE in TM1. I'm not sure that I have enough skin in that game to bother with it, but others may.