I have a data of Patients Date of birth in the format DD-MMM-YY that I am converting first into the Age and then creating Age Groups using Class() function, script is below:
Age(today(),[PATIENT_BIRTHDATE]) as [Patient Age],
Class(Age(today(),[PATIENT_BIRTHDATE]),10,'Age Range') as [Patient Age Group],
The output that I am getting have negative Age counts, which is not correct, DOB I have check and its valid, I am not sure why converted data showing negative Age(s). This is impacting the Age Groups as well that I am creating further. Please see the below screen shot.
Can someone please help me and troubleshot why this weird Output?
Data I am feeding from an excel , I can change it manually but, that will be cumbersome as I need to change things each time new data comes in excel, Can you help us with a way we can convert things in QS itself at the time of data load?
One more thing it gives positive and correct values for the same date format as well, do you think either all or none should be affected if Date format is an issue?
The statement was an example. Without a lot more details about your exact requirements, data model and sample data, I can only guess, but the line example I provided needs to replace the [PATIENT_BIRTHDATE] field as there can only be single instance on the LOAD statement.
Logic will get you from a to b. Imagination will take you everywhere. - A Einstein