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: 
Not applicable

date comparisons

Hi,

I'm having trouble comparing dates using set analysis:

I need to count the following:

1) Number of  patients where [Death_Date] is 7 days or less after [surgery_1_date]

2) Number of patients where  [Death_Date] is between 8 days post [surgery_1_date] and [surgery_2_date]

3) Number of patients where  [Death_Date] is after [discharge date] but before [surgery_2_date] ONLY WHERE [admit_type] ='1'

the best i have is:

=count({$<DEATH_DATE = {"<$(=[surgery_1_date]+7"}>} PAT_ID)

and it doesn't work!

i can't figure out how to intergrate the more elaborate conditions.

please help!

Thanks!!

1 Reply
Anonymous
Not applicable
Author

Usualy the problem with dates in set analysis is with formatting.  Most likely the DEATH_DATE is in date format, and [surgery_1_date]+7 is certainly a number, even if [surgery_1_date] is a date.
Try this:

=count({$<DEATH_DATE = {"<$(=date([surgery_1_date]+7)"}>} PAT_ID)

Regards,

Michael