Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to create a new age group from my excel spreadsheet that just contains the date of birth. I was able to successfully create an Age field (see below) but I don't know how to create the group. I think I'm missing the FROM text but I don't know what to type for the FROM for the age group since I'm making it up vs. pulling it from somewhere. Any ideas? Thanks!
LOAD MRN,
[Patient Name],
DOB,
Age(Today(),DOB) as Age,
Diagnosis,
[Sum of Charges]
FROM
(ooxml, embedded labels, table is Sheet1);
LOAD
if(Age > 10, 'Over 10',
if(Age <= 10 and age >= 6, '6 - 10',
if(Age <= 5 and age >= 4, '4 - 5',
if(Age <= 3 and age >= 1, '1 - 3',
if(Age < 1, 'Under 1'))))) as Age_Group;
Try a preceding load:
LOAD *,
if(Age > 10, 'Over 10',
if(Age <= 10 and age >= 6, '6 - 10',
if(Age <= 5 and age >= 4, '4 - 5',
if(Age <= 3 and age >= 1, '1 - 3',
if(Age < 1, 'Under 1'))))) as Age_Group;
LOAD MRN,
[Patient Name],
DOB,
Age(Today(),DOB) as Age,
Diagnosis,
[Sum of Charges]
FROM
(ooxml, embedded labels, table is Sheet1);
edit: and for better performing options, check this thread: