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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count if time difference <= 30 'mm'

Hello,

I am calculating the time difference using this expression =INTERVAL(InitialEncounterWithDoctorDateTime-ArrivalDateTime,'mm') . Calculation works great!

In the next column, I need an expression that will count if the time difference is <=30 and another column to count when it is >30.

I've tried this expression, but it doesn't work...

 

COUNT(IF(INTERVAL(InitialEncounterWithDoctorDateTime-ArrivalDateTime <=30, 'mm'),(VisitGUID

)))

Any help is appreciated!

2 Replies
eddysanchez
Partner - Creator
Partner - Creator

the count always show 1

Maybe you need:

IF(INTERVAL(InitialEncounterWithDoctorDateTime-ArrivalDateTime <=30, 'mm'),'-30','+30')


rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I think your syntax is

COUNT(

IF(

INTERVAL(InitialEncounterWithDoctorDateTime-ArrivalDateTime, 'mm')<=30,

VisitGUID

)

)

I think you can also do

count(if (ArrivalToProv <=30, 1)

-Rob