Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Calculating a field in a load using data from another table

I am trying to calculate an age based on two tables, one has the birthdate along with a bunch of data related to the birth and the other contains information on measurements taken on various dates. This looks like it should be so simple but I just can't work it out. I think it must be something to do with a resident load but I just can't work out the practical syntax.

The load statement I have looks like this:

Birth:

LOAD BirthGUID,
Region,
Sex,
Date(Date#(Date,'YYYY-MM-DD hh:mm:ss'),'M/D/YYYY')as Birth_Date,
Weightg as Birth_Weight
FROM
[C:\Users\ etc.

Weighing:
LOAD
   BirthGUID,
Date(Date#(Date,'YYYY-MM-DD hh:mm:ss'),'M/D/YYYY') as Weighing_Date,
Weightg as Sample_Weight
FROM
[C:\Users\etc.

I want to be able to calculate the age at weighing as Weighing_Date minus Birth_Date

Thanks so much

1 Reply
sunny_talwar

Something like this

Birth:

LOAD BirthGUID,
     Region,
     Sex,
     Date(Date#(Date,'YYYY-MM-DD hh:mm:ss'),'M/D/YYYY')as Birth_Date,
     Weightg as Birth_Weight
FROM
,
     Weightg as Sample_Weight
FROM
[C:\Users\etc.