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

Date Difference

Hi Team , 

 

Below is the sample data

FormNameEmployee NameSubmission DateApproval DateStatusDays Under Review
Form1Emp112/12/201812/20/2018Rejected 
Form1Emp112/29/201812/31/2018Approved9
Form2Emp212/13/201812/21/2018Rejected 
Form2Emp112/26/201812/27/2018Approved5
Form3Emp312/25/201812/25/2018Approved 
Form4Emp12/29/201812/31/2018Approved 

 

The Requirement is to find the Days Under Review -  Condition is Status = Rejected 

and then Difference between the Approval Date and Resubmitted Date based on Form Name

 

 

Regards,

Senthil

3 Replies
sunny_talwar

Is this something you need from the script or front end? Also, a Form can be rejected for one employee and approved by another?

psenthilbtech
Contributor III
Contributor III
Author

Hi Sunny,

 

Script or Front End anything is ok for me.

It can be rejected by another user and approved by another user

kaanerisen
Creator III
Creator III

Hi,

You can try the script below.

LOAD
    FormName,
    "Employee Name",
     date(date#("Submission Date",'M/D/YYYY')) as "Submission Date",
    date(date#("Approval Date",'M/D/YYYY')) as "Approval Date",
    Status,
    IF(Status='Approved' and Previous(Status)='Rejected' and Previous(FormName)=FormName,date(date#("Submission Date",'M/D/YYYY'))-Previous(date(date#("Approval Date",'M/D/YYYY')))) as "Days Under Review"
FROM [lib://web2]
(html, utf8, embedded labels, table is @1);

Untitled.png

Hope it helps..