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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Inter record date comparison

hi,

I have data in the below format.

IDAdmit dateDischarge datedays
104/11/2014 17:2204/11/2014 19:461
104/11/2014 19:4604/12/2014 19:592
104/12/2014 19:5904/14/2014 21:503
104/14/2014 21:5004/14/2014 21:181

"days" is calculated by considering only the date part (time part is not considered. So "04/14/2014 21:18" is equivalent to "04/14/2014").

For the above scenario, when aggregated by "ID" the sum(days) = 1+2+3+1 = 7 whereas the expected value is"no of days"= 4 (11th, 12th, 13th, 14th)

How to achieve this?

1 Reply
nlmmaurya
Contributor II
Contributor II

Hi,

Try this expression.

sum((Interval([Discharge date]-[Admit date],'dd:hh')))

Regards,

Neelam