Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
bobbydave
Creator III
Creator III

Date difference in two tables

Table1:

Load

   INCIDENT_DATE

From...

Table2:

Load

  BIRTHDATE

From....

I can use an expression to say INTERVAL(BIRTHDATE-INCIDENT_DATE, 'YY')

However, I am wondering how I do this in the script?

1 Solution

Accepted Solutions
maxgro
MVP
MVP

you can but the 2 fields should be in the same table; if not, join the tables or use (if possible) a mapping load

interval example in script

load

  interval(today() - (today()-rand()))

  AutoGenerate 10;

View solution in original post

2 Replies
Not applicable

do you can make direcly...but you tables need stay thogether...

example

load

INCIDENT_DATE,

BIRTHDATE,

BIRTHDATE-INCIDENT_DATE as Day_diference,

year(BIRTHDATE)-year(INCIDENT_DATE ) as year_diference,

age(BIRTHDATE,INCIDENT_DATE ) as age_diference

from ...

maxgro
MVP
MVP

you can but the 2 fields should be in the same table; if not, join the tables or use (if possible) a mapping load

interval example in script

load

  interval(today() - (today()-rand()))

  AutoGenerate 10;