Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
kshitijas
Contributor

Difference between two dates

hello everyone,

I need to findout difference between Completed and alloted date on based of selection of empid.

Status           CreatedDate

Completed     9/2/2016

Alloted           9/23/2016

Thanks

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: Difference between two dates

maybe (it depends on your selection)

max({$<Status={'Completed'}>} CreatedDate) - max({$<Status={'Alloted'}>} CreatedDate)

if you have dates, you can use math to find the difference

8 Replies
lakshmikandh
Valued Contributor II

Re: Difference between two dates

Interval(if(match(Status,'Completed'),CreatedDate)-

if(match(Status,'Alloted'),CreatedDate),'d')

kshitijas
Contributor

Re: Difference between two dates

What is that 'd' for?

lakshmikandh
Valued Contributor II

Re: Difference between two dates

MVP
MVP

Re: Difference between two dates

maybe (it depends on your selection)

max({$<Status={'Completed'}>} CreatedDate) - max({$<Status={'Alloted'}>} CreatedDate)

if you have dates, you can use math to find the difference

kshitijas
Contributor

Re: Difference between two dates

Doesnt work

nagarjuna_kotha
Valued Contributor II

Re: Difference between two dates

May be like this :

if Every employee has single date use below one :

Only({<Status={'Alloted'}>}CreatedDate) - Only({<Status={'Completed'}>}CreatedDate)

and

if Every employee has multiple dates use below one :

Max({<Status={'Alloted'}>}CreatedDate) - Max({<Status={'Completed'}>}CreatedDate)

I hope this may helps

-Nagarjun

Not applicable

Re: Difference between two dates

Try interval(date(Completed,'DD-MM-YYYY')-date(Allotted,'DD-MM-YYYY'),'d').

Here I am assuming that you have two (Completed and Allotted) different fields and you are looking for difference in these dates.

Thanks,

kshitijas
Contributor

Re: Difference between two dates

Thankyou Maxgro ,it worked.