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

Days Late not calculating properly

Hello

I am trying to calculate if a Job has been completed on time.

The Job is completed on time if Resolved Date is less than Due Date.

If the Resolved Date is the same Due Date it is not late.

If the Resolved Date is different to Due Date then it is late.

This is what my results look like at the moment:

Capture.JPG

As you can see Days Late is not calculating properly.

The Script for the field looks like:

LOAD

Resolved_Date - Date_Due as Days_Late

LOAD

Timestamp(Date_Created + ApplyMap('SLA_Map',IssueKey)) as Date_Due,

Date(Resolved_Date) as Resolved_Date

From

Table.qvd;

Date_Due field uses ApplyMap function to get a number to add to the dates to get due date.

Does anyone know how to get the correct results for Days Late?

2 Replies
Anonymous
Not applicable
Author

Hi,

you can simply use the function Interval in order to get the difference (in day, year, ...) between two dates:

load

interval(Resolved_Date - Date_Due, 'd') as Days_Late 

where 'd' gives you the output in days.

You can read the Help for your reference about Interval function.

KR,

Elena

maxgro
MVP
MVP

remove the time part of Date_Due with floor

Resolved_Date - floor(Date_Due) as Days_Late