Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculation with 2 dates

Hi Experts,

if have a problem with a calculation in my LOAD script.

I have the following situation:

when the date is not equal to 01-01-1900 then i want the difference between a date field(Acceptationdate) - datetime field (registeredDate)

So i have the following line in my script:

IF (ACCEPTATIONDATE <> MakeDate(1900,1,1), NUM(ACCEPTATIONDATE - DATE(SEEKERRESPONSEDATETIME)),0 )AS DAYSREGISTERED;

But when i look into my table (preview) and see what is in the column DAYSREGISTERED i not see whole days... for example 140 days. but i see for example 140,68972222

Anybody an idea?

1 Solution

Accepted Solutions
Nicole-Smith

To see whole days (i.e. to change 140,68972222 to 140), you can use the floor function:

IF (ACCEPTATIONDATE <> MakeDate(1900,1,1), FLOOR(NUM(ACCEPTATIONDATE - DATE(SEEKERRESPONSEDATETIME))),0 )AS DAYSREGISTERED;

View solution in original post

1 Reply
Nicole-Smith

To see whole days (i.e. to change 140,68972222 to 140), you can use the floor function:

IF (ACCEPTATIONDATE <> MakeDate(1900,1,1), FLOOR(NUM(ACCEPTATIONDATE - DATE(SEEKERRESPONSEDATETIME))),0 )AS DAYSREGISTERED;