AnsweredAssumed Answered

Age Bracket

Question asked by toby91 on Mar 13, 2018
Latest reply on Mar 14, 2018 by toby91

Hi guys I have a two prong question first my data has a date of birth field, I created another field age and then a button to run this script to populate the age using replace field contents, however I only want it to run when Q11 is not null is this hard to do?? I am not sure the structure when adding the not isNull bit


I specified field (age) and in the replace with calculated results I have this....


Year ( Get ( CurrentDate ) ) - Year ( ML_V1::Q11 ) - ( Get ( CurrentDate ) < Date ( Month ( ML_V1::Q11 ) ; Day ( ML_V1::Q11 ) ; Year ( Get ( CurrentDate ) ) ) )


Secondly, and this I am having real trouble working out, on the same button I am trying to use the age to determine which age bracket so....


I have fields AgeBracket0-18, AgeBracket19-35, so I want it to go if age is between 0 and 18, field (AgeBracket0-18) equals 1 else it is left blank ect. ect. Whats the best way, replace field contents, based on an If function somehow including a range.


Thanks for the help again, in the meantime I will keep fiddling and see if I can work it out.