Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

hammermill21
Contributor II

Counting the differences between two dates greater than 24

Hello,

I have two dates/;

Call Date & Work Date, I want to count the days between those two days that are greater than 24. I tried this:

(Count([Call Date] - [Work Date])) > 24 but that is not working

Thank you

1 Solution

Accepted Solutions

Re: Counting the differences between two dates greater than 24

May be this

Sum(If([Call Date] - [Work Date] > 24, 1, 0))

9 Replies

Re: Counting the differences between two dates greater than 24

May be this

Sum(If([Call Date] - [Work Date] > 24, 1, 0))

kuczynska
Contributor III

Re: Counting the differences between two dates greater than 24

Date1-Date2  will give you the difference in days, so you simply have to wrap it in the statement Sunny wrote above.

clondono
Contributor III

Re: Counting the differences between two dates greater than 24

Hi Elizabeth,

How about using set analysis. Maybe something like:

count(<{NetWorkDays([Call Date], [Work Date]={"> 24"}>},NetWorkDays([Call Date], [Work Date])) 


Thanks,

Carlos

consultant_bi
Contributor

Re: Counting the differences between two dates greater than 24

Hello Carlos

i thought about the same thing

clondono
Contributor III

Re: Counting the differences between two dates greater than 24

Thanks Fathi,

I just noticed that I am missing a parenthesis in my expression.

Here is the revised code:

count(<{NetWorkDays([Call Date], [Work Date])={"> 24"}>},NetWorkDays([Call Date], [Work Date]))

Re: Counting the differences between two dates greater than 24

This won't work as you cannot use functions/calculations on the left hand side of a set modifier... you can perform the same calculation in the script to create a field as an alternative

zebhashmi
Valued Contributor

Re: Counting the differences between two dates greater than 24

I think

Count(If([Work Date] - [Call Date] > 1, 1))

asuming 24 hrs


hammermill21
Contributor II

Re: Counting the differences between two dates greater than 24

Thank you

hammermill21
Contributor II

Re: Counting the differences between two dates greater than 24

Thank you for your help!

Community Browser