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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
apoorvasd
Creator II
Creator II

Get the count of number of days between two dates if they are greater than zero

Hello everyone,

I have a requirement where I need to get the count of values in a field which are greater than Zero.

I have three fields namely, "Date Completed", "Target Completion Date" (both are Date fields) and "DateCompleted - TargetCompletionDate". Field, "DateCompleted - TargetCompletionDate" has values which is the difference of "Date Completed" and "Target Completion Date" (ie., No. of days between the two dates) as shown in the attached picture. Now, I need to get the count of these values which are greater than zero.

I am trying the following expression, count([DateCompleted - TargetCompletionDate])>0 but not getting the desired output. I get -1 as the result which should be 9 as per the attached example.

Any help on this?

Thank you.

1 Solution

Accepted Solutions
prat1507
Specialist
Specialist

Hi

Please use count({<[DateCompleted - TargetCompletionDate]={'>0'}>}[DateCompleted - TargetCompletionDate])

Regards

Pratyush

View solution in original post

2 Replies
prat1507
Specialist
Specialist

Hi

Please use count({<[DateCompleted - TargetCompletionDate]={'>0'}>}[DateCompleted - TargetCompletionDate])

Regards

Pratyush

apoorvasd
Creator II
Creator II
Author

Hi Pratyush,

Thank you very much

It's working !